Repository navigation
Conversation
7e4b79c to
3c7faaa
Compare
3c7faaa to
d5998b1
Compare
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
| case w: WholeStageTransformer => | ||
| // AQE can copy this union with unresolved attributes during canonicalization. | ||
| // Only compute its output for backends that require the merged schema. | ||
| case w: WholeStageTransformer if BackendsApiManager.getSettings.needOutputSchemaForPlan() => |
There was a problem hiding this comment.
This still evaluates output on canonicalized copies for ClickHouse, where needOutputSchemaForPlan() is true (CHBackend.scala:381), and the new test fails there with the original error (ClickHouse CI build 22820, Spark35 UT: - Gluten - rebalance a union that implicitly casts non-nullable map values *** FAILED *** ... UnresolvedException: Invalid call to nullable on unresolved object). Canonicalized children can be unresolved on any backend; could the constructor skip the schema push when the child is canonicalized, or move setOutputSchemaForPlan out of the constructor, instead of keying on the backend? The union's own canonicalized flag is only set after doCanonicalize() returns, so the check would have to be on the child; a canonicalized WholeStageTransformer is never transformed (WholeStageTransformer.scala:102), so it doesn't need the schema.
What changes are proposed in this pull request?
Fixes #13823.
During AQE stage creation, Spark canonicalizes the physical plan and copies
ColumnarUnionExec. WhenUNION ALLimplicitly casts a map with non-nullable values, the copied child can contain an unresolved output attribute. The union constructor evaluatesoutputto pass the merged schema toWholeStageTransformer, which reads the attribute's nullability and throwsInvalid call to nullable on unresolved object.Check
needOutputSchemaForPlan()before evaluatingoutput. Velox skips the unnecessary schema computation, while ClickHouse continues to receive the merged schema it uses to align union branches.How was this patch tested?
Added unit tests
Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-6)