Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/14355
  
    Hi, @hvanhovell .
    There is two cases statements including mine (the second one). May I change 
both? Actually, I followed the style of the previous one.
    ```scala
     case s: Union if s.children.exists(_.output.length != 
s.children.head.output.length) =>
        val firstError = s.children.find(_.output.length != 
s.children.head.output.length).get
        failAnalysis(
          s"Unions can only be performed on tables with the same number of 
columns, " +
            s"but one table has '${firstError.output.length}' columns and 
another table has " +
            s"'${s.children.head.output.length}' columns")
    
    + case Union(c) if c.exists(_.output.map(_.dataType) != 
c.head.output.map(_.dataType)) =>
    +   val firstError = c.find(_.output.map(_.dataType) != 
c.head.output.map(_.dataType)).get
    +     failAnalysis(
    +       s"Unions can only be performed on tables with the compatible column 
types, " +
    +         s"but one table has '[${c.head.output.map(_.dataType).mkString(", 
")}]' " +
    +         s"and another table has 
'[${firstError.output.map(_.dataType).mkString(", ")}]'")
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to