-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[SPARK-52156][SQL] Put legacy CREATE TEMPORARY TABLE ... USING provider under the flag #50902
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
base: master
Are you sure you want to change the base?
[SPARK-52156][SQL] Put legacy CREATE TEMPORARY TABLE ... USING provider under the flag #50902
Conversation
@@ -361,6 +361,11 @@ class SparkSqlAstBuilder extends AstBuilder { | |||
invalidStatement("CREATE TEMPORARY TABLE IF NOT EXISTS", ctx) | |||
} | |||
|
|||
if (ctx.tableProvider != null | |||
&& conf.getConf(SQLConf.BLOCK_CREATE_TEMP_TABLE_WITH_PROVIDER)) { | |||
throw invalidStatement("CREATE TEMPORARY TABLE ... USING", ctx) |
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.
shall have customize the error message to say that they can do CREATE TEMP VIEW ... USING
instead?
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.
Should we just move the check under the logWarning which is already there or create separate error?
@@ -250,6 +250,13 @@ object SQLConf { | |||
.booleanConf | |||
.createWithDefault(true) | |||
|
|||
val BLOCK_CREATE_TEMP_TABLE_USING_PROVIDER = | |||
buildConf("spark.sql.blockCreateTempTableUsingProvider") |
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.
should the conf under spark.sql.legacy.
namespace? e.g. spark.sql.legacy.allowCreateTempTableUsingProvider
, and don't forget the .version("4.1.0")
though it's an internal conf
What changes were proposed in this pull request?
Blocking legacy feature of CREATE TEMPORARY TABLE ... USING under the flag. The default keeps it enabled.
Why are the changes needed?
CREATE TEMPORARY TABLE ... USING provider uses legacy path which creates views with LogicalPlan for storage instead of sqlText. This could pose a problem for systems that rely on sqlText being present and we want to provide users with the option to disable it.
Does this PR introduce any user-facing change?
No, just a guard for a legacy feature.
How was this patch tested?
Test added to the relevant suite.
Was this patch authored or co-authored using generative AI tooling?
No.