vladimirg-db commented on code in PR #50727:
URL: https://github.com/apache/spark/pull/50727#discussion_r2062684500


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -531,7 +531,10 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
     def apply(plan: LogicalPlan): LogicalPlan = {
       val collatedPlan =
         if 
(conf.getConf(SQLConf.RUN_COLLATION_TYPE_CASTS_BEFORE_ALIAS_ASSIGNMENT)) {
-          CollationTypeCasts(plan)
+          Seq(
+            ApplyDefaultCollationToStringType,

Review Comment:
   Please move this to a separate `applyCollationRules` private method.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala:
##########
@@ -52,6 +52,11 @@ object ApplyDefaultCollationToStringType extends 
Rule[LogicalPlan] {
       case createView: CreateView =>
         createView.collation
 
+      // Temporary views are created via CreateViewCommand, which we can't 
import here.
+      // Instead, we use the CreateTempView trait to access the collation.
+      case createTempView: CreateTempView =>

Review Comment:
   Not sure why this change is needed to fix the aliases. Are you trying to 
solve some other unrelated problem in the same PR? If so, please create another 
PR.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to