-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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-34770][SQL] InMemoryCatalog.tableExists should not fail if database doesn't exist #31860
Conversation
@@ -704,6 +704,9 @@ abstract class SessionCatalogSuite extends AnalysisTest with Eventually { | |||
catalog.createTempView("tbl3", tempTable, overrideIfExists = false) | |||
// tableExists should not check temp view. | |||
assert(!catalog.tableExists(TableIdentifier("tbl3"))) | |||
|
|||
// Id database doesn't exist, return false instead of failing. | |||
assert(!catalog.tableExists(TableIdentifier("tbl1", Some("non-exist")))) |
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.
Before this PR, this test passes in HiveExternalSessionCatalogSuite
, but fails in InMemorySessionCatalogSuite
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
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.
+1, LGTM.
Thank you, @cloud-fan .
The scala 2.13 failure is unrelated, I'm merging it to master/3.1, thanks for the review! |
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
…abase doesn't exist This PR updates `InMemoryCatalog.tableExists` to return false if database doesn't exist, instead of failing. The new behavior is consistent with `HiveExternalCatalog` which is used in production, so this bug mostly only affects tests. bug fix no a new test Closes #31860 from cloud-fan/catalog. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 1a4971d) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…abase doesn't exist This PR updates `InMemoryCatalog.tableExists` to return false if database doesn't exist, instead of failing. The new behavior is consistent with `HiveExternalCatalog` which is used in production, so this bug mostly only affects tests. bug fix no a new test Closes apache#31860 from cloud-fan/catalog. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 1a4971d) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…abase doesn't exist This PR updates `InMemoryCatalog.tableExists` to return false if database doesn't exist, instead of failing. The new behavior is consistent with `HiveExternalCatalog` which is used in production, so this bug mostly only affects tests. bug fix no a new test Closes apache#31860 from cloud-fan/catalog. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 1a4971d) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
This PR updates
InMemoryCatalog.tableExists
to return false if database doesn't exist, instead of failing. The new behavior is consistent withHiveExternalCatalog
which is used in production, so this bug mostly only affects tests.Why are the changes needed?
bug fix
Does this PR introduce any user-facing change?
no
How was this patch tested?
a new test