-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-30282][SQL] Migrate SHOW TBLPROPERTIES to new framework #26921
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
5d8422d
db311fd
fc2c5a3
ae524c3
467145f
7b5816a
6de67d2
517793f
a845488
625596b
72b3307
4fe3e69
fb47ea9
1ff1dcd
23b743c
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 |
---|---|---|
|
@@ -130,10 +130,10 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto | |
} | ||
|
||
test("show tblproperties for datasource table - errors") { | ||
val message1 = intercept[NoSuchTableException] { | ||
val message = intercept[AnalysisException] { | ||
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. Ur, this sounds like another behavior change from Apache Spark 2.4.4. 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. Thanks for catching it! I will update the migration guide. 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. Created a follow-up PR: #27276 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. Thanks! |
||
sql("SHOW TBLPROPERTIES badtable") | ||
}.getMessage | ||
assert(message1.contains("Table or view 'badtable' not found in database 'default'")) | ||
assert(message.contains("Table not found: badtable")) | ||
|
||
// When key is not found, a row containing the error is returned. | ||
checkAnswer( | ||
|
@@ -147,16 +147,18 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto | |
checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('`prop2Key`')"), Row("prop2Val")) | ||
} | ||
|
||
test("show tblproperties for spark temporary table - empty row") { | ||
test("show tblproperties for spark temporary table - AnalysisException is thrown") { | ||
withTempView("parquet_temp") { | ||
sql( | ||
""" | ||
|CREATE TEMPORARY VIEW parquet_temp (c1 INT, c2 STRING) | ||
|USING org.apache.spark.sql.parquet.DefaultSource | ||
""".stripMargin) | ||
|
||
// An empty sequence of row is returned for session temporary table. | ||
checkAnswer(sql("SHOW TBLPROPERTIES parquet_temp"), Nil) | ||
val message = intercept[AnalysisException] { | ||
sql("SHOW TBLPROPERTIES parquet_temp") | ||
}.getMessage | ||
assert(message.contains("parquet_temp is a temp view not table")) | ||
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 LGTM, but can we add a note in the migration guide? 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. Sure, I will add it. Thanks! |
||
} | ||
} | ||
|
||
|
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.
We allow users to specify the table properties when creating temporary views.
Instead of disallowing it, I think we should support it.
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 will create a PR for this.
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.
Upon looking at this further, properties specified in
CREATE TEMP VIEW
is not used inCreateViewCommand
, so we can revert the behavior back to the original one where we showed empty properties. What do you think?I will still create a PR to support a permanent view, which is a regression.
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.
sounds good to me. please remove the item in the migration guide too.
Thanks!