MaxGekk commented on code in PR #47609:
URL: https://github.com/apache/spark/pull/47609#discussion_r1721662744
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -4830,6 +4830,11 @@
"<variableName> is a VARIABLE and cannot be updated using the SET
statement. Use SET VARIABLE <variableName> = ... instead."
]
},
+ "SQL_SCRIPTING_NOT_ENABLED" : {
+ "message" : [
+ "SQL scripting is under development and not all features are
supported. To enable existing features set <sqlScriptingEnabled> to `true`."
Review Comment:
It is obvious that the feature is not supported since this is a sub-class of
`UNSUPPORTED_FEATURE`. Would be better just shortly describe the feature itself.
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -4830,6 +4830,11 @@
"<variableName> is a VARIABLE and cannot be updated using the SET
statement. Use SET VARIABLE <variableName> = ... instead."
]
},
+ "SQL_SCRIPTING_NOT_ENABLED" : {
Review Comment:
The words `NOT_ENABLED` are not needed, just leave `SQL_SCRIPTING`.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -117,18 +117,20 @@ class AstBuilder extends DataTypeAstBuilder
}
override def visitCompoundOrSingleStatement(
- ctx: CompoundOrSingleStatementContext): CompoundBody = withOrigin(ctx) {
+ ctx: CompoundOrSingleStatementContext): LogicalPlan = withOrigin(ctx) {
Option(ctx.singleCompoundStatement()).map { s =>
+ if (conf.getConf(SQLConf.SQL_SCRIPTING_ENABLED)) {
Review Comment:
Why don't you use the active config object `conf.`? See other places in the
file how to retrieve configs.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -3355,6 +3355,14 @@ object SQLConf {
.version("2.3.0")
.fallbackConf(org.apache.spark.internal.config.STRING_REDACTION_PATTERN)
+ val SQL_SCRIPTING_ENABLED =
+ buildConf("spark.sql.scripting.enabled")
+ .doc("SQL Scripting feature is under development and its use should be
done under this" +
Review Comment:
The doc should describe the feature shortly.
--
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]