-
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 aggregate function map_agg. #51967
Conversation
be/src/exprs/agg/map_agg.h
Outdated
using KeyType = typename SliceHashSet::key_type; | ||
|
||
MyHashMap hash_map; | ||
void update(MemPool* mem_pool, |
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.
It seems other system implement has a max limit for map_agg
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'm not sure. It seems that the map_agg of Trino does not have a limit, all my implement is simulating the one in Trino.
@stdpain Thanks for the review again! I have changed the code according to your review. Could you please help me review again? |
@stdpain Thanks for all the reviews! |
@stdpain Hi, I'm sorry that I forgot to commit a part of FE codes. Could you please review this again? |
https://github.com/Mergifyio rebase main |
❌ Unable to rebase: user
|
https://github.com/Mergifyio rebase main |
✅ Branch has been successfully rebased |
8879316
to
82f913f
Compare
d6cd77d
to
dde5d83
Compare
@stdpain Hello, the CI passed(The failure in admit test seems has nothing with this PR.) and I have changed the implement way of the value in map, using a column to store values instead in order to keep the reference of slices. |
c1a7ef4
to
19cab15
Compare
key_column->append(*src[0], i, 1); | ||
value_column->append(*src[1], i, 1); | ||
offsets.push_back(offsets.back() + 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.
} | |
} | |
if (dst->is_nullable()) { | |
down_cast<NullableColumn*>(dst)->null_column_data().resize(dst->size() + chunk_size); | |
} |
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.
Thanks for the review! Done.
Signed-off-by: Song Jiacheng <[email protected]>
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 19 / 19 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 70 / 84 (83.33%) file detail
|
Thanks for all the reviews! |
Why I'm doing:
Map_agg is an aggregate function to generate map value, which is frequently used in Trino. To support migrate from Trino to Starrocks, develop the same function in Starrocks.
Related issue #40894
What I'm doing:
I tried 3 ways to develop this function:
I think the 3rd one will be the best one, and the behavior is just like Trino.
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: