File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -659,12 +659,14 @@ object CombineConcats extends Rule[LogicalPlan] {
659659 Concat (flattened)
660660 }
661661
662+ private def hasNestedConcats (concat : Concat ): Boolean = concat.children.exists {
663+ case c : Concat => true
664+ case c @ Cast (Concat (children), StringType , _) => true
665+ case _ => false
666+ }
667+
662668 def apply (plan : LogicalPlan ): LogicalPlan = plan.transformExpressionsDown {
663- case concat : Concat if concat.children.exists {
664- case c : Concat => true
665- case c @ Cast (Concat (children), StringType , _) => true
666- case _ => false
667- } =>
669+ case concat : Concat if hasNestedConcats(concat) =>
668670 flattenConcats(concat)
669671 }
670672}
You can’t perform that action at this time.
0 commit comments