yaooqinn commented on code in PR #13824:
URL: https://github.com/apache/gluten/pull/13824#discussion_r4725300403
##########
gluten-substrait/src/main/scala/org/apache/gluten/execution/BasicPhysicalOperatorTransformer.scala:
##########
@@ -240,7 +240,9 @@ case class ColumnarUnionExec(children: Seq[SparkPlan],
partitioning: Partitionin
extends ValidatablePlan {
require(children.nonEmpty, "ColumnarUnionExec requires at least one child.")
children.foreach {
- 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() =>
Review 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](https://opencicd.kyligence.com/job/gluten/job/gluten-ci/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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]