cloud-fan commented on code in PR #50436: URL: https://github.com/apache/spark/pull/50436#discussion_r2020644750
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala: ########## @@ -987,9 +987,17 @@ class SessionCatalog( parser.parseQuery(viewText) } } + // The metadata.viewText contains only the AS query part of CREATE VIEW statement + // and does not include the DEFAULT COLLATION part, resulting in a plan without collation. + val plan = if (metadata.collation.isDefined) { + val newType = StringType(metadata.collation.get) + ResolveDDLCommandStringTypes.transformPlan(parsedPlan, newType) Review Comment: Does this work for unresolved parsed plan? I feel it's better to match the `View` node and transform its child to resolve collation, which is similar to how we match DDL/DML commands. -- 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