Skip to content

[GLUTEN-9176][CH] Rewrite aggregate if to aggregate with filter clause#9185

Merged
taiyang-li merged 3 commits intoapache:mainfrom
bigo-sg:gluten_9176
Apr 3, 2025
Merged

[GLUTEN-9176][CH] Rewrite aggregate if to aggregate with filter clause#9185
taiyang-li merged 3 commits intoapache:mainfrom
bigo-sg:gluten_9176

Conversation

@taiyang-li
Copy link
Copy Markdown
Contributor

@taiyang-li taiyang-li commented Mar 31, 2025

What changes were proposed in this pull request?

Rewrite aggregate if to aggregate with filter clause to use CH aggregate combinator -If .

  • Rule1: sum(if(cond, expr, 0)) -> sum(expr) FILTER (WHERE cond)
  • Rule2: func(if(cond, expr, null)) -> func(expr) FILTER (WHERE cond)

(Fixes: #9176)

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

@github-actions
Copy link
Copy Markdown

#9176

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2025

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2025

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2025

Run Gluten Clickhouse CI on x86

Copy link
Copy Markdown
Contributor

@zhanglistar zhanglistar left a comment

Choose a reason for hiding this comment

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

LGTM

@taiyang-li taiyang-li merged commit e49f033 into apache:main Apr 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CH] optimize aggregate function with if expression as its argument

2 participants