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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collationExpressions.scala:
##########
@@ -67,7 +73,13 @@ object CollateExpressionBuilder extends ExpressionBuilder {
  */
 case class Collate(child: Expression, collationName: String)
   extends UnaryExpression with ExpectsInputTypes {
-  private val collationId = CollationFactory.collationNameToId(collationName)
+  private val collationId = if (!SQLConf.get.collationEnabled) {
+    // This is here if someone enters a query which only has invalid collation 
name
+    throw QueryCompilationErrors.collationNotEnabledError()

Review Comment:
   I managed to fix this by setting `collationName` to lazy val in 
visitCollate. 



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