shivadarshan-devadiga commented on code in PR #60756:
URL: https://github.com/apache/spark/pull/60756#discussion_r4651421072


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:
##########
@@ -504,20 +527,64 @@ object Union {
     Union (left :: right :: Nil)
   }
 
-  // updating nullability to make all the children consistent
-  def mergeChildOutputs(childOutputs: Seq[Seq[Attribute]]): Seq[Attribute] = {
-    childOutputs.transpose.map { attrs =>
+  // updating nullability to make all the children consistent, and the raw 
types to
+  // `charRawTypes`, the raw types with the widest CHAR lengths of the 
children, see
+  // widerCharRawTypes. ApplyCharTypePadding pads the values of the shorter 
ones.
+  def mergeChildOutputs(

Review Comment:
   Done, as described above. The cases you listed follow from it:
   - The sequential streaming union isn't a `Union`, so it is neither padded 
nor widened, as before this PR.
   - With `charVarcharAsString` there are no raw types, so nothing is padded.
   - A Project over the union gets the widest length.
   `readsRecursiveReference` stays, so that the union of the anchor and the 
recursive term isn't padded before it becomes the `UnionLoop`.



-- 
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]

Reply via email to