Skip to content

[VL] Refactor getAggRelInternal in HashAggregateExecTransformer#11040

Merged
philo-he merged 3 commits intoapache:mainfrom
Zouxxyy:dev/refa-hash-agg
Nov 11, 2025
Merged

[VL] Refactor getAggRelInternal in HashAggregateExecTransformer#11040
philo-he merged 3 commits intoapache:mainfrom
Zouxxyy:dev/refa-hash-agg

Conversation

@Zouxxyy
Copy link
Copy Markdown
Contributor

@Zouxxyy Zouxxyy commented Nov 6, 2025

What changes are proposed in this pull request?

Refactor from

if (rowConstructNeeded(...)) {
  ...
  getAggRelWithRowConstruct(input, ...)
} else {
  getAggRelInternal(input, ...)
}

to

val finalInput = if (rowConstructNeeded(...)) {
  ...
  applyRowConstruct(input, ...)
} else {
  input
}

getAggRelInternal(finalInput, ...)

How was this patch tested?

@github-actions github-actions Bot added the VELOX label Nov 6, 2025
@Zouxxyy
Copy link
Copy Markdown
Contributor Author

Zouxxyy commented Nov 7, 2025

@philo-he Can you have a look, thanks

@philo-he philo-he changed the title [MINOR] Refactor getAggRelInternal in HashAggregateExecTransformer [VL] Refactor getAggRelInternal in HashAggregateExecTransformer Nov 10, 2025
Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

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

Looks good. One minor comment.

@liujiayi771, do you have any comments?

@@ -272,13 +265,12 @@ abstract class HashAggregateExecTransformer(
// Add a projection node before aggregation for row constructing.
// Mainly used for aggregation whose intermediate type is a compound type in Velox.
// Pre-projection is always not required for final stage.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you help improve this comment to:
Pre-projection is never required for final stages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@liujiayi771, please confirm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@philo-he Yes. Final aggregation does not require pre-projection.

@liujiayi771
Copy link
Copy Markdown
Contributor

@philo-he The failed CI tests should not be related to the changes in this PR.

@philo-he philo-he merged commit 27d71c8 into apache:main Nov 11, 2025
99 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants