Skip to content

Conversation

@wenjiecn
Copy link

What problem does this PR solve?

Issue Number: close #121

Type of Change

  • πŸ› Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • πŸš€ Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • πŸ”¨ Refactoring (no logic changes)
  • πŸ”§ Build/CI or Infrastructure changes
  • πŸ“ Documentation only

Description

Create an aggNode in the intermediate phase in the agg operator, and use the aggNode to create three Intermediate groupingSet operators to process group data of groups 1 to 3. The original partial groupingSet operator processes data in group 0.
The total data input is reduced to reduce the HashTable operation time, which is optimized in the rollup scenario.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).

  • Positive Impact: I have run benchmarks.

    Click to view Benchmark Results

TPCDS99 1T results in velox.
q22
Before: 13.686s
After: 11.256s (+17.76%)
q67
Before: 152.416s
After: 136.983 (+10.13%)
```

  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

Please describe the changes in this PR

Release Note:

Release Note:
- Identifies the execution plan of the 1. expand->agg; 2. expand->projection->agg in the LocalPlanner and sets the flag of the rollup scenario to the operator.
- Add a flag to the expand operator to generate only data of group 0.
- Create an aggNode in the intermediate phase in the agg operator, and use the aggNode to create three Intermediate groupingSet operators to process group data of groups 1 to 3. The original partial groupingSet operator processes data in group 0.

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No

  • Yes (Description: ...)

    Click to view Breaking Changes
    Breaking Changes:
    - Description of the breaking change.
    - Possible solutions or workarounds.
    - Any other relevant information.
    

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

for (auto step = 0; step < projections.size(); step++) {
if (auto constTypedExpr =
std::dynamic_pointer_cast<const core::ConstantTypedExpr>(projections[step][numColumns - 1])) {
if (constTypedExpr->value().value<int64_t>() != ((int64_t)(pow(2, step) - 1))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (constTypedExpr->value().value<int64_t>() != ((int64_t)(pow(2, step) - 1))) {
if (constTypedExpr->value().value<int64_t>() != ((1LL << step) - 1)) {

} else if (
auto expandNode =
std::dynamic_pointer_cast<const core::ExpandNode>(planNode)) {
#if defined(__ARM_FEATURE_SVE) && defined(__aarch64__)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this optimize arm sve related ?

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.

[Feature] Add rollup optimized for HashAggregation

3 participants