Add operator GROUPING SETS#24172
Conversation
|
nice job |
|
The tests are missing, did you forget |
| break; | ||
|
|
||
| size_t first_column_to_add = (i == 0 ? 1 : 0); | ||
| auto adding_column_action = ActionsDAG::makeAddingColumnActions(pipeline.getHeader().getByPosition(params.keys_vector[first_column_to_add][0])); |
There was a problem hiding this comment.
That's suspicious.
What if we have two sets with the same prefix?
For (a, b), (a, c) we add const column a for both, replacing normal column with default one.
| expression_transforms.push_back(std::make_shared<ExpressionTransform>(aggregating_transforms[i]->getOutputs().front().getHeader(), actions)); | ||
|
|
||
| } | ||
| pipeline.addParallelTransforms(std::move(aggregating_transforms)); |
There was a problem hiding this comment.
The same could be done with addSimpleTransform, cause aggregating one input and one output port.
But maybe this method will be useful later, when we remove pipeline.resize(1);
KochetovNicolai
left a comment
There was a problem hiding this comment.
So far so good.
Also, we need to remove all debug output
…ter grouping sets
|
I try to reproduce the test case from website: https://oracle-base.com/articles/misc/rollup-cube-grouping-functions-and-grouping-sets
In Oracle, the result is FACT_1_ID FACT_2_ID FACT_3_ID SALES_VALUE GROUPING_ID The result in this implementation: FACT_1_ID FACT_2_ID FACT_3_ID SALES_VALUE GROUPING_ID The result of this implementation is quite different from the result in Oracle. I suppose there is some issue with this implementation. Correct me if I am wrong |
|
@KochetovNicolai Hi, KochetovNicolai, I'm trying to fix grouping sets multiple elements related issue, i wonder if we should support no parenthesis |
|
@taylor12805 Hi!
Do you need some help with it? I think I may also finish this pr, but I would really appreciate any assistance from you. |
@KochetovNicolai Hi! |
|
What code changes have been done to handle the empty set with () parenthesis, at the parsing level? For example ((A),()). |
|
|
|
GROUPING SETS are added in #26869 |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):