File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -668,21 +668,17 @@ object TypeCoercion {
668668 */
669669 case class ConcatCoercion (conf : SQLConf ) extends TypeCoercionRule {
670670
671- private def typeCastToString (c : Concat ): Concat = {
672- val newChildren = c.children.map { e =>
673- ImplicitTypeCasts .implicitCast(e, StringType ).getOrElse(e)
674- }
675- c.copy(children = newChildren)
676- }
677-
678671 override protected def coerceTypes (plan : LogicalPlan ): LogicalPlan = plan transform { case p =>
679672 p transformExpressionsUp {
680673 // Skip nodes if unresolved or empty children
681674 case c @ Concat (children) if ! c.childrenResolved || children.isEmpty => c
682675
683676 case c @ Concat (children) if conf.concatBinaryAsString ||
684677 ! children.map(_.dataType).forall(_ == BinaryType ) =>
685- typeCastToString(c)
678+ val newChildren = c.children.map { e =>
679+ ImplicitTypeCasts .implicitCast(e, StringType ).getOrElse(e)
680+ }
681+ c.copy(children = newChildren)
686682 }
687683 }
688684 }
You can’t perform that action at this time.
0 commit comments