-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] support struct column late materialized #28222
Conversation
6f6a817
to
b637626
Compare
void resize(size_t n) override { _size = n; } | ||
void resize(size_t n) override { | ||
if (_size == 0) { | ||
_data->resize(1); |
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.
why we need call resize when _size == 0
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.
I need resize column to keep same rows when fill default value
void append_default(size_t count) override { | ||
if (_size == 0) { | ||
_data->append_default(1); | ||
} | ||
_size += count; | ||
} |
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.
reject if data is not emtpy?
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, don't need reject, only need modified size
array_column->elements_column()->append_default(1); | ||
array_column->elements_column() = ConstColumn::create(array_column->elements_column(), num_to_read); |
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.
array_column must be emtpy before append_default()?
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.
yeah, must be empty
|
||
size_t size_to_read = 0; | ||
for (size_t i = 0; i < size; ++i) { | ||
RETURN_IF_ERROR(_array_size_iterator->seek_to_ordinal_and_calc_element_ordinal(rowids[i])); | ||
size_t element_ordinal = _array_size_iterator->element_ordinal(); | ||
RETURN_IF_ERROR(_element_iterator->seek_to_ordinal(element_ordinal)); | ||
size_to_read += array_size.get_data()[i]; | ||
} | ||
|
||
array_column->elements_column()->append_default(size_to_read); |
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.
in else {} ?
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.
yeah, for mock read data
|
||
StructColumn* struct_column = nullptr; | ||
NullColumn* null_column = nullptr; | ||
if (dst->is_nullable()) { |
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.
would dst be set const ? may be a subfield in struct{struct{},struct{stuct{}}}
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.
the method only call once on empty chunk, so I think never be const
2626df8
to
a5740fe
Compare
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.
LGTM
[FE PR Coverage Check]😍 pass : 4 / 5 (80.00%) file detail
|
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
Signed-off-by: Seaven <[email protected]>
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
[FE Incremental Coverage Report]😍 pass : 4 / 5 (80.00%) file detail
|
[BE Incremental Coverage Report]😞 fail : 45 / 246 (18.29%) file detail
|
@@ -288,6 +288,7 @@ public class SessionVariable implements Serializable, Writable, Cloneable { | |||
"enable_rewrite_groupingsets_to_union_all"; | |||
|
|||
public static final String CBO_USE_DB_LOCK = "cbo_use_lock_db"; | |||
public static final String CBO_PREDICATE_SUBFIELD_PATH = "cbo_enable_predicate_subfield_path"; |
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.
need cbo_
prefix?
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.
just for easy search
* [Enhancement] support struct column late materialized --------- Signed-off-by: Seaven <[email protected]>
Fixes #issue
support late materialized on struct column
/structA/structB/structC
, can't prune the subfield ofstructB
(/structA/array/structB
), because the interface ofarray/map
doesn't support now,array/map
need flatten rows when fetch values by rowid, it's too complexDoesn't support on map/array, because only few scenarios when use
MAP_SIZE/ARRAY_LENGTH = xx
as scan predicateWhat type of PR is this:
Checklist:
Bugfix cherry-pick branch check: