-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[WIP](dynamic-table) support dynamic schema table #16335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0d8ce83
61fd41d
f2ee7cc
aed6429
56190cc
903150a
eb01724
5239393
d3e5e29
766a4e5
a61ba90
6a362cc
f7037c8
98de1ba
956eb17
9bff039
cf042b3
5cd5c28
50bc05a
aa011d7
c24163a
4bcabc4
f1b35a1
d11e928
9a4c789
22d17bb
156cf7d
f9a4bb7
5c07d34
37d7134
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,7 +149,13 @@ int MemTable::RowInBlockComparator::operator()(const RowInBlock* left, | |
|
|
||
| void MemTable::insert(const vectorized::Block* input_block, const std::vector<int>& row_idxs) { | ||
| SCOPED_CONSUME_MEM_TRACKER(_insert_mem_tracker_use_hook.get()); | ||
| auto target_block = input_block->copy_block(_column_offset); | ||
| vectorized::Block target_block = *input_block; | ||
| if (!_tablet_schema->is_dynamic_schema()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add comment for why not copy_block for dynamic schema
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| // This insert may belong to a rollup tablet, rollup columns is a subset of base table | ||
| // but for dynamic table, it's need full columns, so input_block should ignore _column_offset | ||
| // of each column and avoid copy_block | ||
| target_block = input_block->copy_block(_column_offset); | ||
| } | ||
| if (_is_first_insertion) { | ||
| _is_first_insertion = false; | ||
| auto cloneBlock = target_block.clone_without_columns(); | ||
|
|
@@ -159,6 +165,13 @@ void MemTable::insert(const vectorized::Block* input_block, const std::vector<in | |
| if (_keys_type != KeysType::DUP_KEYS) { | ||
| _init_agg_functions(&target_block); | ||
| } | ||
| if (_tablet_schema->is_dynamic_schema()) { | ||
| // Set _input_mutable_block to dynamic since | ||
| // input blocks may be structure-variable(dyanmic) | ||
| // this will align _input_mutable_block with | ||
| // input_block and auto extends columns | ||
| _input_mutable_block.set_block_type(vectorized::BlockType::DYNAMIC); | ||
| } | ||
| } | ||
|
|
||
| auto num_rows = row_idxs.size(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -361,7 +361,6 @@ class RowsetMeta { | |
| int64_t newest_write_timestamp() const { return _rowset_meta_pb.newest_write_timestamp(); } | ||
|
|
||
| void set_tablet_schema(const TabletSchemaSPtr& tablet_schema) { | ||
| DCHECK(_schema == nullptr); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why delete DCHECK?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set_tablet_schema could override original _schema |
||
| _schema = TabletSchemaCache::instance()->insert(tablet_schema->to_key()); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does new scanners still use BaseScanner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no new load scan will use vfile_scanner