-
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
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 |
|---|---|---|
|
|
@@ -38,6 +38,12 @@ trait ShowNamespacesSuiteBase extends command.ShowNamespacesSuiteBase { | |
| }.getMessage | ||
| assert(errMsg.contains("Namespace 'dummy' not found")) | ||
| } | ||
|
|
||
| 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")) | ||
|
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. 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.
Contributor
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.
That's an important reason. +1 for this. |
||
| } | ||
| } | ||
| } | ||
|
|
||
| class ShowNamespacesSuite extends ShowNamespacesSuiteBase with CommandSuiteBase { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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
outputfield 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.