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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala:
##########
@@ -24,88 +24,72 @@ import org.apache.spark.sql.connector.catalog.TableCatalog
 import org.apache.spark.sql.types.{DataType, StringType}
 
 /**
- * Resolves string types in DDL commands, where the string type inherits the
- * collation from the corresponding object (table/view -> schema -> catalog).
+ * Resolves string types in logical plans by assigning them the appropriate 
collation. The
+ * collation is inherited from the relevant object in the hierarchy (e.g., 
table/view → schema →
+ * catalog). This rule is primarily applied to DDL commands, but it can also 
be triggered in other
+ * scenarios. For example, when querying a view, its query is re-resolved each 
time, and that query
+ * can take various forms.
  */
-object ResolveDDLCommandStringTypes extends Rule[LogicalPlan] {
+object ApplyDefaultCollationToStringType extends Rule[LogicalPlan] {

Review Comment:
   Otherwise it's confusing - we are applying collations to string types in the 
`CollationTypeCoercion`, but for some reason the logic of applying a 
view-originated collation is in some separate rule outside.



-- 
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

Reply via email to