File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,18 @@ trait CheckAnalysis {
105105
106106 cleaned.foreach(checkValidAggregateExpression)
107107
108+ case u @ Union (left, right) if left.output.size != right.output.size =>
109+ failAnalysis(
110+ s " union's left child and right child have different output size. " +
111+ s " union node: $u left output size: ${left.output.size}, " +
112+ s " right output size: ${right.output.size}" )
113+
114+ case u @ Union (left, right) if left.output.zip(right.output).exists(z => z._1.dataType != z._2.dataType) =>
115+ failAnalysis(
116+ s " union's left child and right child have different output types. " +
117+ s " union node: $u. left output datatypes: ${left.output.map(_.dataType)}, " +
118+ s " right output datatypes: ${right.output.map(_.dataType)}" )
119+
108120 case _ => // Fallbacks to the following checks
109121 }
110122
You can’t perform that action at this time.
0 commit comments