Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19977#discussion_r157122520
--- 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)
+
+ override def inputTypes: Seq[AbstractDataType] =
+ Seq.fill(children.size)(if (isBinaryMode) BinaryType else StringType)
+ override def dataType: DataType = if (isBinaryMode) BinaryType else
StringType
--- End diff --
Conf is needed for sure. We also need a `Migration Guide`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]