cloud-fan commented on code in PR #50053: URL: https://github.com/apache/spark/pull/50053#discussion_r1971639864
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveDDLCommandStringTypes.scala: ########## @@ -121,6 +124,29 @@ object ResolveDDLCommandStringTypes extends Rule[LogicalPlan] { newType => Literal(value, replaceDefaultStringType(dt, newType)) } + /** + * Casts [[DefaultStringProducingExpression]] in the plan to the `newType`. + */ + private def castDefaultStringExpressions(plan: LogicalPlan, newType: StringType): LogicalPlan = { + if (newType == StringType) return plan + + plan.mapChildren { operator => + operator.mapExpressions { expression => + expression.mapChildren { Review Comment: ``` if (containsChild.nonEmpty) { withNewChildren(children.map(f)) } else { this } ``` There is no recursion, how does it transform the full tree? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org