-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17899][SQL] add a debug mode to keep raw table properties in HiveExternalCatalog #15458
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ package org.apache.spark.sql.internal | |
|
|
||
| import org.apache.hadoop.fs.Path | ||
|
|
||
| import org.apache.spark.SparkContext | ||
| import org.apache.spark.sql._ | ||
| import org.apache.spark.sql.execution.WholeStageCodegenExec | ||
| import org.apache.spark.sql.internal.StaticSQLConf._ | ||
|
|
@@ -254,18 +255,21 @@ class SQLConfSuite extends QueryTest with SharedSQLContext { | |
| } | ||
| } | ||
|
|
||
| test("global SQL conf comes from SparkConf") { | ||
| val newSession = SparkSession.builder() | ||
| .config(SCHEMA_STRING_LENGTH_THRESHOLD.key, "2000") | ||
| .getOrCreate() | ||
|
|
||
| assert(newSession.conf.get(SCHEMA_STRING_LENGTH_THRESHOLD.key) == "2000") | ||
| checkAnswer( | ||
| newSession.sql(s"SET ${SCHEMA_STRING_LENGTH_THRESHOLD.key}"), | ||
| Row(SCHEMA_STRING_LENGTH_THRESHOLD.key, "2000")) | ||
| test("static SQL conf comes from SparkConf") { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change is not related to this PR.
This is the same approach I used in the new test, so I include this unrelated change in this PR. |
||
| val previousValue = sparkContext.conf.get(SCHEMA_STRING_LENGTH_THRESHOLD) | ||
| try { | ||
| sparkContext.conf.set(SCHEMA_STRING_LENGTH_THRESHOLD, 2000) | ||
| val newSession = new SparkSession(sparkContext) | ||
| assert(newSession.conf.get(SCHEMA_STRING_LENGTH_THRESHOLD) == 2000) | ||
| checkAnswer( | ||
| newSession.sql(s"SET ${SCHEMA_STRING_LENGTH_THRESHOLD.key}"), | ||
| Row(SCHEMA_STRING_LENGTH_THRESHOLD.key, "2000")) | ||
| } finally { | ||
| sparkContext.conf.set(SCHEMA_STRING_LENGTH_THRESHOLD, previousValue) | ||
| } | ||
| } | ||
|
|
||
| test("cannot set/unset global SQL conf") { | ||
| test("cannot set/unset static SQL conf") { | ||
| val e1 = intercept[AnalysisException](sql(s"SET ${SCHEMA_STRING_LENGTH_THRESHOLD.key}=10")) | ||
| assert(e1.message.contains("Cannot modify the value of a static config")) | ||
| val e2 = intercept[AnalysisException](spark.conf.unset(SCHEMA_STRING_LENGTH_THRESHOLD.key)) | ||
|
|
||
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.
Let's add doc for this flag.
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.
Sure, I can do a quick PR to fix it.