-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49501][SQL] Fix double-escaping of table location #47976
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 1 commit
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 |
|---|---|---|
|
|
@@ -700,7 +700,7 @@ class CatalogSuite extends SharedSparkSession with AnalysisTest with BeforeAndAf | |
| val description = "this is a test table" | ||
|
|
||
| withTable("t") { | ||
| withTempDir { dir => | ||
| withTempDir(prefix = "test%prefix") { dir => | ||
|
||
| spark.catalog.createTable( | ||
| tableName = "t", | ||
| source = "json", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,17 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Creates a temporary directory with the provided prefix, which is then passed to `f` and will | ||
| * be deleted after `f` returns. | ||
|
||
| */ | ||
| protected override def withTempDir(prefix: String)(f: File => Unit): Unit = { | ||
| super.withTempDir(prefix) { dir => | ||
| f(dir) | ||
| waitForTasksToFinish() | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * A helper function for turning off/on codegen. | ||
| */ | ||
|
|
||
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.
just in case, shall we add a legacy config to restore to the old behavior?
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.
I thought about this. I did not add a config because the change in behaviour is only for new tables. Existing tables should continue working. I am also suspecting that there is no real usage of this API for tables with special chars. But I don't have a strong opinion. WDYT?
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.
OK let's keep it simple. double escaping is definitely a bug and no one should rely on it (existing tables won't be affected)