Skip to content

[VL][DELTA] Reconcile struct field names in CaseWhen/If for Velox SWITCH compatibility#11948

Open
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/structFieldName
Open

[VL][DELTA] Reconcile struct field names in CaseWhen/If for Velox SWITCH compatibility#11948
acvictor wants to merge 1 commit intoapache:mainfrom
acvictor:acvictor/structFieldName

Conversation

@acvictor
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Delta column mapping remaps struct field names to physical UUIDs (col-), but MERGE plan CaseWhen branches can mix physical and logical field names. Velox SWITCH requires exact type matching including field names, causing InvariantViolationException on MERGE with column-mapped struct columns:

 InvariantViolationException: VeloxRuntimeError
 Error Code: INVALID_STATE
 Reason: Else clause of a SWITCH statement must have the same type as 'then' clauses.
   Expected ROW<"col-e49d92e3-0b53-46a2-ba29-c928d381433d":INTEGER>,
   but got ROW<foo:INTEGER>

This PR adds StructTypeReconciler that detects struct field name mismatches across conditional expression branches and wraps mismatched branches in ROW casts to normalize field names. Handles nested structs, arrays of structs, and maps.

How was this patch tested?

Added UT

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

No

@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from 50de41e to 54304e2 Compare April 16, 2026 06:31
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from 672804b to 0b40007 Compare April 16, 2026 08:56
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from 0b40007 to e3b1a2e Compare April 16, 2026 10:22
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from e3b1a2e to 7e0cd8b Compare April 16, 2026 14:13
@acvictor acvictor marked this pull request as ready for review April 16, 2026 14:13
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from 7e0cd8b to eb26bba Compare April 16, 2026 14:40
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@acvictor acvictor force-pushed the acvictor/structFieldName branch from eb26bba to 68d06f3 Compare April 17, 2026 05:51
@github-actions
Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

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.

1 participant