-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-33432][SQL] SQL parser should use active SQLConf #30357
Conversation
Test build #131011 has finished for PR 30357 at commit
|
a166c40
to
6d02b6c
Compare
Kubernetes integration test starting |
Kubernetes integration test status success |
cc @cloud-fan |
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogV2Implicits.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/expressions/expressions.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/ansi/json-functions.sql
Outdated
Show resolved
Hide resolved
Test build #131031 has finished for PR 30357 at commit
|
...r/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
Outdated
Show resolved
Hide resolved
...hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
Outdated
Show resolved
Hide resolved
8464da0
to
4139f6d
Compare
sql/core/src/test/resources/sql-tests/inputs/ansi/parse-schema-string.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one comment
Kubernetes integration test starting |
Kubernetes integration test status success |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #131047 has finished for PR 30357 at commit
|
Test build #131049 has finished for PR 30357 at commit
|
Test build #131053 has finished for PR 30357 at commit
|
assertEqual("a rlike '^\\x20[\\x20-\\x23]+$'", 'a rlike "^\\x20[\\x20-\\x23]+$", parser) | ||
assertEqual("a rlike 'pattern\\\\'", 'a rlike "pattern\\\\", parser) | ||
assertEqual("a rlike 'pattern\\t\\n'", 'a rlike "pattern\\t\\n", parser) | ||
withSQLConf(SQLConf.ESCAPED_STRING_LITERALS.key -> "true") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style changes look like another benefit. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Thank you , @luluorta and @cloud-fan .
I also verified in spark-shell interactively.
Merged to master for Apache Spark 3.1.
If this is required at |
What changes were proposed in this pull request?
This PR makes SQL parser using active SQLConf instead of the one in ctor-parameters.
Why are the changes needed?
In ANSI mode, schema string parsing should fail if the schema uses ANSI reserved keyword as attribute name:
output:
But this query may accidentally succeed in certain cases cause the DataType parser sticks to the configs of the first created session in the current thread:
output:
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Newly and updated UTs