Repository navigation
[vectorized][feature](planner)(executor)support grouping sets,rollup,cube(#7599) - #7601
Conversation
HappenLee
left a comment
There was a problem hiding this comment.
some problem need to recheck
| #include "vec/data_types/get_least_supertype.h" | ||
|
|
||
| namespace doris::vectorized { | ||
| class FunctionGroupingId : public IFunction { |
There was a problem hiding this comment.
the funcion GroupingId and Grouping is similar, you should do a union abstruct. like other funcion maybe the FunctionToNoNullableOneArgument
|
|
||
| Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, | ||
| size_t result, size_t input_rows_count) override { | ||
| if (arguments.size() != 1) |
There was a problem hiding this comment.
No Need Check here, you set get_number_of_arguments() == 1
| bool src_is_nullable = src_column.type->is_nullable(); | ||
| TypeIndex src_typeid = src_column.type->get_type_id(); | ||
| TypeIndex res_typeid = rel_column.type->get_type_id(); | ||
| if (res_typeid != TypeIndex::Int64) |
There was a problem hiding this comment.
no need check here, FE will promise the argment is bigint
| return Status::InternalError("Return type is not int64 of function grouping_id"); | ||
|
|
||
| MutableColumnPtr res_column = rel_column.type->create_column(); | ||
| if (src_is_nullable) { |
There was a problem hiding this comment.
the argument may nullable ? maybe we should promise the argument is not nullable and DCHECK here
| for (int i = 0; i < aggregateExprStartIndex; ++i) { | ||
| SlotDescriptor slot = aggOutTupleDescriptor.getSlots().get(i); | ||
| if (!slot.getIsNullable()) | ||
| slot.setIsNullable(true); |
There was a problem hiding this comment.
why change the slot nullable ? give a problem case please
df5577f to
94b0728
Compare
HappenLee
left a comment
There was a problem hiding this comment.
some little problem and rebase code again
| return Status::OK(); | ||
| } | ||
|
|
||
| Status VRepeatNode::get_repeated_block(Block* child_block, int repeat_id_idx, Block* output_Block) { |
There was a problem hiding this comment.
output_Block -> output_block
| size_t column_size = _output_slots.size(); | ||
| bool mem_reuse = output_Block->mem_reuse(); | ||
| DCHECK_EQ(child_column_size, _child_slots.size()); | ||
| DCHECK_LE(child_column_size, column_size); |
| // set slot null not in repeat_ids | ||
| if (is_set_null_slot) { | ||
| for (size_t j = 0; j < src_column.column->size(); ++j) { | ||
| nullable_column->insert_data(nullptr, 0); |
There was a problem hiding this comment.
This code maybe can not SIMD? maybe should call resize function to set nullable_column size to SIMD
| _repeat_id_idx++; | ||
|
|
||
| int size = _repeat_id_list.size(); | ||
| if (_repeat_id_idx >= size) { |
There was a problem hiding this comment.
why here reset the _child_block, call release_block_memory to reuse the mem of _child_block
| #include "function_grouping.h" | ||
|
|
||
| namespace doris::vectorized { | ||
| void register_function_grouping(SimpleFunctionFactory& factory) { |
There was a problem hiding this comment.
void register_function_grouping(SimpleFunctionFactory& factory) {
factory.register_function();
factory.register_function();
}
d57faf3 to
0d81f2b
Compare
0d81f2b to
b5fa480
Compare
Proposed changes
Close related #7599
Support grouping sets,rollup,cube
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...