-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-34786: [C++] Fix output schema calculated by Substrait consumer for AggregateRel #34885
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
Conversation
…mer for AggregateRel
|
|
| } | ||
|
|
||
| Result<const HashAggregateKernel*> GetKernel(ExecContext* ctx, const Aggregate& aggregate, | ||
| void DefaultAggregateOptions(Aggregate* aggregate_ptr, |
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 do we need to add this?
| using GetKernel = std::function<Result<const Kernel*>(ExecContext*, Aggregate*, | ||
| const std::vector<TypeHolder>&)>; | ||
|
|
||
| Result<const Kernel*> GetScalarAggregateKernel(ExecContext* ctx, Aggregate* aggregate_ptr, |
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.
What is this used for?
| std::vector<const Kernel*> kernels(in_types.size()); | ||
| for (size_t i = 0; i < aggregates.size(); ++i) { | ||
| ARROW_ASSIGN_OR_RAISE(kernels[i], GetKernel(ctx, aggregates[i], in_types[i])); | ||
| ARROW_ASSIGN_OR_RAISE(kernels[i], get_kernel(ctx, &aggregates[i], in_types[i])); |
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 this change?
| auto ctx = plan_->query_context()->exec_context(); | ||
| KernelContext kernel_ctx{ctx}; | ||
| kernel_ctx.SetState(state->agg_states[i].get()); | ||
| kernel_ctx.SetState(state->agg_states[i][0].get()); |
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 this change?
| Status ResetKernelStates() { | ||
| auto ctx = plan()->query_context()->exec_context(); | ||
| ARROW_RETURN_NOT_OK(InitKernels(agg_kernels_, ctx, aggs_, agg_src_types_)); | ||
| ARROW_RETURN_NOT_OK(InitKernels(InitHashAggregateKernel, agg_kernels_, ctx, |
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 passing do we need to pass /*num_states_per_kernel=*/1?
|
@rtpsw Not sure I follow what you are doing - seems like a lot of refactor is done. Can you explain your approach? |
cpp/src/arrow/acero/aggregate_node.h
Outdated
| using compute::KernelState; | ||
| using compute::RowSegmenter; | ||
|
|
||
| struct ARROW_ACERO_EXPORT AggregateNodeArgs { |
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 do we need this?
In this PR, the main goal is a single method
Additional parts of the refactoring are:
|
|
Replaced by #34904 |
…mer for AggregateRel (apache#34904) See apache#34786 * Closes: apache#34786 Can replace apache#34885 Lead-authored-by: Yaron Gvili <rtpsw@hotmail.com> Co-authored-by: rtpsw <rtpsw@hotmail.com> Co-authored-by: Weston Pace <weston.pace@gmail.com> Signed-off-by: Weston Pace <weston.pace@gmail.com>
…mer for AggregateRel (apache#34904) See apache#34786 * Closes: apache#34786 Can replace apache#34885 Lead-authored-by: Yaron Gvili <rtpsw@hotmail.com> Co-authored-by: rtpsw <rtpsw@hotmail.com> Co-authored-by: Weston Pace <weston.pace@gmail.com> Signed-off-by: Weston Pace <weston.pace@gmail.com>
See #34786