MaxGekk commented on code in PR #47423:
URL: https://github.com/apache/spark/pull/47423#discussion_r1718577091


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -119,11 +120,13 @@ class AstBuilder extends DataTypeAstBuilder
   override def visitCompoundOrSingleStatement(
       ctx: CompoundOrSingleStatementContext): CompoundBody = withOrigin(ctx) {
     Option(ctx.singleCompoundStatement()).map { s =>
+      if (!SQLConf.get.sqlScriptingEnabled) {

Review Comment:
   Why don't you get the current config value from the active config obj 
`conf`? See other examples in the same file like 
`conf.getConf(SQLConf.ENABLE_DEFAULT_COLUMNS)`



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/SqlScriptingErrors.scala:
##########
@@ -43,6 +44,40 @@ private[sql] object SqlScriptingErrors {
       messageParameters = Map("endLabel" -> endLabel))
   }
 
+  def sqlScriptingNotEnabled(origin: Origin): Throwable = {
+    new SqlScriptingException(
+      origin = origin,
+      errorClass = "UNSUPPORTED_FEATURE.SQL_SCRIPTING_NOT_ENABLED",
+      cause = null,
+      messageParameters = Map("sqlScriptingEnabled" -> 
SQLConf.SQL_SCRIPTING_ENABLED.key))

Review Comment:
   Please, follow the existing convention and quote the SQL config name using 
`toSQLConf()`



##########
sql/core/src/test/resources/sql-tests/results/literals.sql.out:
##########
@@ -269,7 +269,7 @@ org.apache.spark.sql.catalyst.parser.ParseException
   "errorClass" : "PARSE_SYNTAX_ERROR",
   "sqlState" : "42601",
   "messageParameters" : {
-    "error" : "'.'",
+    "error" : "end of input",

Review Comment:
   Could you explain why this PR changes this error parameter?



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