mihailom-db commented on code in PR #45285:
URL: https://github.com/apache/spark/pull/45285#discussion_r1505984306


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collationExpressions.scala:
##########
@@ -40,6 +41,12 @@ import org.apache.spark.sql.types._
   group = "string_funcs")
 object CollateExpressionBuilder extends ExpressionBuilder {
   override def build(funcName: String, expressions: Seq[Expression]): 
Expression = {
+    // Needed in order to make sure no parse errors appear when Collation 
Support is not enabled
+    // because this might suggest to the customer that feature is enabled 
until they reproduce
+    // the right syntax
+    if (!SQLConf.get.collationEnabled) {
+      throw QueryCompilationErrors.collationNotEnabledError()
+    }

Review Comment:
   Changed now, but needed to keep some check in the builder, as analyzer did 
not fail if collation name was wrong, and we would give confusing messages to 
the user in that case. I presume we do not want to give them suggestions on how 
to fix syntax if collation is disabled.



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