Skip to content
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

feat: Support Emit::First for SumDecimalGroupsAccumulator #47

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 20, 2024

Which issue does this PR close?

Closes #46.

Rationale for this change

If the upstream operator of HashAggregate is sorted, HashAggregate will try to emit first groups if possible. Our custom SumDecimalGroupsAccumulator doesn't support Emit::First. So if Sort is followed by HashAggregate and there is sum of decimal, the query will fail with:

        at std::backtrace::Backtrace::create(__internal__:0)                                                                                                                                                                           
        at comet::errors::init::{{closure}}(__internal__:0)                                                                                                                                                                            
        at std::panicking::rust_panic_with_hook(__internal__:0)                                                                                                                                                                        
        at std::panicking::begin_panic_handler::{{closure}}(__internal__:0)                                                                                                                                                            
        at std::sys_common::backtrace::__rust_end_short_backtrace(__internal__:0)                                                                                                                                                      
        at _rust_begin_unwind(__internal__:0)                                                                                                                                                                                          
        at core::panicking::panic_fmt(__internal__:0)                                                                                                                                                                                  
        at <comet::execution::datafusion::expressions::sum_decimal::SumDecimalGroupsAccumulator as datafusion_physical_expr::aggregate::groups_accumulator::GroupsAccumulator>::state(__internal__:0)                                  
        at datafusion_physical_plan::aggregates::row_hash::GroupedHashAggregateStream::emit(__internal__:0)                                                                                                                            
        at <datafusion_physical_plan::aggregates::row_hash::GroupedHashAggregateStream as futures_core::stream::Stream>::poll_next(__internal__:0)                                                                                     
        at <datafusion_physical_plan::aggregates::row_hash::GroupedHashAggregateStream as futures_core::stream::Stream>::poll_next(__internal__:0)                                                                                     
        at <datafusion_physical_plan::projection::ProjectionStream as futures_core::stream::Stream>::poll_next(__internal__:0)                                                                                                         
        at std::panicking::try::do_call(__internal__:0)                                                                                                                                                                                
        at _Java_org_apache_comet_Native_executePlan(__internal__:0)     

What changes are included in this PR?

How are these changes tested?

@viirya
Copy link
Member Author

viirya commented Feb 20, 2024

CI tests are passed. The failure is due to

WARNING: /Users/runner/hostedtoolcache/Java_Adopt_jdk/17.0.10-7/x64/Contents/Home/bin/java is loading libcrypto in an unsafe way

@sunchao
Copy link
Member

sunchao commented Feb 20, 2024

@viirya I think you need to rebase this PR

@viirya
Copy link
Member Author

viirya commented Feb 20, 2024

Hmm, I think I already rebased on latest main.

@sunchao
Copy link
Member

sunchao commented Feb 20, 2024

Hmm not sure. The same issue happened to #40 and it is OK now after the rebasing.

@viirya
Copy link
Member Author

viirya commented Feb 20, 2024

I re-triggered the pipeline.

@sunchao
Copy link
Member

sunchao commented Feb 20, 2024

Hmm maybe the libcrypto issue is not completely fixed 😢

@viirya
Copy link
Member Author

viirya commented Feb 20, 2024

Hmm, it is actually flaky. Retriggered run is okay.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It might be better to add some details in PR description :)

@viirya viirya merged commit ca54845 into apache:main Feb 20, 2024
6 checks passed
@viirya
Copy link
Member Author

viirya commented Feb 20, 2024

Merged and added details in the PR description. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Emit::First for SumDecimalGroupsAccumulator
2 participants