Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19977#discussion_r157125671
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
 ---
    @@ -50,15 +51,23 @@ import org.apache.spark.unsafe.types.{ByteArray, 
UTF8String}
       """)
     case class Concat(children: Seq[Expression]) extends Expression with 
ImplicitCastInputTypes {
     
    -  override def inputTypes: Seq[AbstractDataType] = 
Seq.fill(children.size)(StringType)
    -  override def dataType: DataType = StringType
    +  private lazy val isBinaryMode = children.nonEmpty && 
children.forall(_.dataType == BinaryType)
    --- End diff --
    
    `pg` and `hive` have the same;
    ```
    postgres=# create table t1(a bytea, b bytea, c varchar, d varchar);
    postgres=# create view v1 as select a || b || c || d from t1;
    postgres=# \d v1
       View "public.view41_1"
      Column  | Type | Modifiers 
    ----------+------+-----------
     ?column? | text | 
    
    
    hive> create table t1(a binary, b binary, c text, d test);
    hive> create view v1 as select a || b || c || d from t1;
    hive> describe v1;
    _c0                         string  
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to