cloud-fan commented on code in PR #49351: URL: https://github.com/apache/spark/pull/49351#discussion_r1903876905
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala: ########## @@ -462,6 +462,59 @@ object Union { } } +abstract class UnionBase extends LogicalPlan { + // updating nullability to make all the children consistent + override def output: Seq[Attribute] = { + if (conf.getConf(SQLConf.LAZY_SET_OPERATOR_OUTPUT)) { + lazyOutput + } else { + computeOutput() + } + } + + override def metadataOutput: Seq[Attribute] = Nil + + private lazy val lazyOutput: Seq[Attribute] = computeOutput() + + private def computeOutput(): Seq[Attribute] = Union.mergeChildOutputs(children.map(_.output)) + + /** + * Maps the constraints containing a given (original) sequence of attributes to those with a + * given (reference) sequence of attributes. Given the nature of union, we expect that the + * mapping between the original and reference sequences are symmetric. + */ + private def rewriteConstraints( + reference: Seq[Attribute], Review Comment: nit: 4 spaces indentation. Please follow the code style of the previous code: https://github.com/apache/spark/pull/49351/files#diff-0ac2c89f8cc0d00e8fe7717b01697f36f20fe8abf2def09bcfde0ad84b30e467L552 -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org