Skip to content

[VL] Fix shallow CreateNamedStruct detection in CollapseProjectExecTransformer#11953

Merged
acvictor merged 2 commits intoapache:mainfrom
acvictor:acvictor/collapsePattern
Apr 17, 2026
Merged

[VL] Fix shallow CreateNamedStruct detection in CollapseProjectExecTransformer#11953
acvictor merged 2 commits intoapache:mainfrom
acvictor:acvictor/collapsePattern

Conversation

@acvictor
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

containsNamedStructAlias in CollapseProjectExecTransformer guards against collapsing project nodes when CreateNamedStruct is present, since Velox generates a special obj output that breaks bind reference resolution after collapse. The existing pattern match only detects CreateNamedStruct as the direct child of Alias and misses CreateNamedStruct nested inside any wrapper expression like If, CaseWhen allowing unsafe collapse that causes Velox bind reference failures at runtime. This PR uses expression.exists to walk the full subtree.

How was this patch tested?

Existing UT

Was this patch authored or co-authored using generative AI tooling?

No

@acvictor acvictor marked this pull request as ready for review April 17, 2026 07:16
@acvictor acvictor requested a review from liujiayi771 April 17, 2026 07:17
@github-actions github-actions bot added the CORE works for Gluten Core label Apr 17, 2026
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@liujiayi771
Copy link
Copy Markdown
Contributor

@acvictor Thanks for the fix. Could you add a test case for that error case, if possible?

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 7b0ddbf to 447340f Compare April 17, 2026 08:51
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 447340f to 40df8a7 Compare April 17, 2026 11:07
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 40df8a7 to 15d54fc Compare April 17, 2026 11:08
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 15d54fc to 91a356d Compare April 17, 2026 12:35
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 91a356d to 4f567cf Compare April 17, 2026 13:31
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/collapsePattern branch from 4f567cf to 059cd45 Compare April 17, 2026 15:11
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

Copy link
Copy Markdown
Contributor

@jinchengchenghh jinchengchenghh left a comment

Choose a reason for hiding this comment

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

Thanks for your fix!

@acvictor
Copy link
Copy Markdown
Contributor Author

@acvictor Thanks for the fix. Could you add a test case for that error case, if possible?

Added UTs for all Spark versions.

@acvictor acvictor merged commit 584d1b5 into apache:main Apr 17, 2026
60 checks passed
@acvictor acvictor deleted the acvictor/collapsePattern branch April 17, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants