Github user tejasapatil commented on the issue:

    https://github.com/apache/spark/pull/19977
  
    As per hive implementation of CONCAT(), [these are the rules 
used](https://github.com/apache/hive/blob/ff67cdda1c538dc65087878eeba3e165cf3230f4/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java#L71-L77)
 : 
    - All CHAR inputs: return CHAR
    - All VARCHAR inputs: return VARCHAR
    - All CHAR/VARCHAR inputs: return VARCHAR
    - All BINARY inputs: return BINARY
    - Otherwise return STRING
    - [one corner 
case](https://github.com/apache/hive/blob/ff67cdda1c538dc65087878eeba3e165cf3230f4/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcat.java#L116-L118):
 If all arguments are of known length then we can keep track of the max length 
of the return type. However if the return length exceeds the max length for the 
char/varchar, then the return type reverts to string.
    
    We would still need to handle `CHAR` the way hive does.


---

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

Reply via email to