-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-20439] [SQL] Fix Catalog API listTables and getTable when failed to fetch table metadata #17730
Conversation
Test build #76072 has finished for PR 17730 at commit
|
if (tableExists(dbName, tableName)) { | ||
makeTable(TableIdentifier(tableName, Option(dbName))) | ||
} else { | ||
throw new AnalysisException(s"Table or view '$tableName' not found in database '$dbName'") |
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.
The doc says This throws an AnalysisException when no Table can be found.
, I think we should not change this 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.
Yes. That is why an AnalysisException
is issued here. makeTable
eats the expected exception.
LGTM, merging to master/2.2! |
…d to fetch table metadata ### What changes were proposed in this pull request? `spark.catalog.listTables` and `spark.catalog.getTable` does not work if we are unable to retrieve table metadata due to any reason (e.g., table serde class is not accessible or the table type is not accepted by Spark SQL). After this PR, the APIs still return the corresponding Table without the description and tableType) ### How was this patch tested? Added a test case Author: Xiao Li <gatorsmile@gmail.com> Closes #17730 from gatorsmile/listTables. (cherry picked from commit 776a2c0) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
should we backport this to earlier releases too? |
Sure, will do it to 2.1 |
…ble when failed to fetch table metadata ### What changes were proposed in this pull request? This PR is to backport #17730 to Spark 2.1 --- -- `spark.catalog.listTables` and `spark.catalog.getTable` does not work if we are unable to retrieve table metadata due to any reason (e.g., table serde class is not accessible or the table type is not accepted by Spark SQL). After this PR, the APIs still return the corresponding Table without the description and tableType) ### How was this patch tested? Added a test case Author: Xiao Li <gatorsmile@gmail.com> Closes #17760 from gatorsmile/backport-17730.
…d to fetch table metadata ### What changes were proposed in this pull request? `spark.catalog.listTables` and `spark.catalog.getTable` does not work if we are unable to retrieve table metadata due to any reason (e.g., table serde class is not accessible or the table type is not accepted by Spark SQL). After this PR, the APIs still return the corresponding Table without the description and tableType) ### How was this patch tested? Added a test case Author: Xiao Li <gatorsmile@gmail.com> Closes apache#17730 from gatorsmile/listTables.
What changes were proposed in this pull request?
spark.catalog.listTables
andspark.catalog.getTable
does not work if we are unable to retrieve table metadata due to any reason (e.g., table serde class is not accessible or the table type is not accepted by Spark SQL). After this PR, the APIs still return the corresponding Table without the description and tableType)How was this patch tested?
Added a test case