-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34359][SQL] Add a legacy config to restore the output schema of SHOW DATABASES #31474
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
Conversation
| namespace: LogicalPlan, | ||
| pattern: Option[String]) extends Command { | ||
| pattern: Option[String], | ||
| override val output: Seq[Attribute] = ShowNamespaces.OUTPUT) extends Command { |
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 think it's better to put the output field in the constructor so that it's more stable (copying the node will not regenerate the output attributes again). It also helps if we want to support self-join later.
|
|
||
| test("SPARK-34359: keep the legacy output schema") { | ||
| withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> "true") { | ||
| assert(sql("SHOW NAMESPACES").schema.fieldNames.toSeq == Seq("databaseName")) |
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.
Usually, people don't rely on the output schema of commands, but some BI tools may rely on it and users are not able to update the BI tools. That's why I think it deserves a legacy config.
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.
Usually, people don't rely on the output schema of commands, but some BI tools may rely on it and users are not able to update the BI tools. That's why I think it deserves a legacy config.
That's an important reason. +1 for this.
imback82
left a comment
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
|
Test build #134877 has finished for PR 31474 at commit
|
Co-authored-by: Hyukjin Kwon <gurwls223@gmail.com>
|
The last commit just updates the migration guide, I'm merging it to master, thanks all for the review! I'll backport it 3.1/3.0 soon. |
…f SHOW DATABASES This is a followup of apache#26006 In apache#26006 , we merged the v1 and v2 SHOW DATABASES/NAMESPACES commands, but we missed a behavior change that the output schema of SHOW DATABASES becomes different. This PR adds a legacy config to restore the old schema, with a migration guide item to mention this behavior change. Improve backward compatibility No (the legacy config is false by default) a new test Closes apache#31474 from cloud-fan/command-schema. Lead-authored-by: Wenchen Fan <cloud0fan@gmail.com> Co-authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…ema of SHOW DATABASES This backports #31474 to 3.1/3.0 ### What changes were proposed in this pull request? This is a followup of #26006 In #26006 , we merged the v1 and v2 SHOW DATABASES/NAMESPACES commands, but we missed a behavior change that the output schema of SHOW DATABASES becomes different. This PR adds a legacy config to restore the old schema, with a migration guide item to mention this behavior change. ### Why are the changes needed? Improve backward compatibility ### Does this PR introduce _any_ user-facing change? No (the legacy config is false by default) ### How was this patch tested? a new test Closes #31486 from cloud-fan/command-schema. Authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…ema of SHOW DATABASES This backports #31474 to 3.1/3.0 This is a followup of #26006 In #26006 , we merged the v1 and v2 SHOW DATABASES/NAMESPACES commands, but we missed a behavior change that the output schema of SHOW DATABASES becomes different. This PR adds a legacy config to restore the old schema, with a migration guide item to mention this behavior change. Improve backward compatibility No (the legacy config is false by default) a new test Closes #31486 from cloud-fan/command-schema. Authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 7c87b48) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
This is a followup of #26006
In #26006 , we merged the v1 and v2 SHOW DATABASES/NAMESPACES commands, but we missed a behavior change that the output schema of SHOW DATABASES becomes different.
This PR adds a legacy config to restore the old schema, with a migration guide item to mention this behavior change.
Why are the changes needed?
Improve backward compatibility
Does this PR introduce any user-facing change?
No (the legacy config is false by default)
How was this patch tested?
a new test