MaxGekk commented on code in PR #45285:
URL: https://github.com/apache/spark/pull/45285#discussion_r1504888862
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -297,6 +297,14 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase with Compilat
)
}
+ def collationNotEnabledError(): Throwable = {
+ new AnalysisException(
+ errorClass = "UNSUPPORTED_FEATURE.COLLATION",
+ messageParameters = Map(
+ "collationEnabled" -> SQLConf.COLLATION_ENABLED.key)
Review Comment:
Please, quote the SQL config by `toSQLConf`
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collationExpressions.scala:
##########
@@ -90,6 +100,9 @@ case class Collate(child: Expression, collationName: String)
since = "4.0.0",
group = "string_funcs")
case class Collation(child: Expression) extends UnaryExpression with
RuntimeReplaceable {
+ if (!SQLConf.get.collationEnabled) {
Review Comment:
Could you add the parameter `collationEnabled` to the case class, and avoid
the check in the constructor. This will avoid an issue fixed by this PR:
https://github.com/apache/spark/pull/27658 (see `Why are the changes needed?`)
--
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]