-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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-32156][TESTS][SQL] Refactor two similar test cases from SPARK-31061 in HiveExternalCatalogSuite #28980
[SPARK-32156][TESTS][SQL] Refactor two similar test cases from SPARK-31061 in HiveExternalCatalogSuite #28980
Conversation
val parquetTable = CatalogTable( | ||
identifier = TableIdentifier("parq_tbl", Some("db1")), | ||
tableType = CatalogTableType.MANAGED, | ||
storage = storageFormat.copy(locationUri = Some(new URI("file:/some/path"))), |
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.
file:/some/path
seems not very suitable.
val rawTable = externalCatalog.getTable("db1", "parq_tbl") | ||
assert(rawTable.provider === Some("parquet")) | ||
|
||
val fooTable = parquetTable.copy(provider = Some("foo")) |
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.
Seems we should use rawTable
get from catalog instead of parquetTable
from the beginning.
catalog.alterTable(fooTable) | ||
val alteredTable = externalCatalog.getTable("db1", "parq_tbl") | ||
assert(alteredTable.provider === Some("foo")) | ||
Seq("parquet", "hive").foreach(i => { |
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.
nit: foreach(i => {
-> foreach { provider =>
ok to test |
Test build #124900 has finished for PR 28980 at commit
|
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, @TJX2014 and all.
Merged to master.
Thank you very much. |
What changes were proposed in this pull request?
1.Merge two similar tests for SPARK-31061 and make the code clean.
2.Fix table alter issue due to lose path.
Why are the changes needed?
Because this two tests for SPARK-31061 is very similar and could be merged.
And the first test case should use
rawTable
instead ofparquetTable
to alter.Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit test.