-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27690][SQL] Remove materialized views first in HiveClientImpl.reset
#24592
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
Conversation
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
Outdated
Show resolved
Hide resolved
|
Test build #105361 has finished for PR 24592 at commit
|
HiveClientImpl.reset
HiveClientImpl.resetHiveClientImpl.reset
|
Thank you for updating, @wangyum ! |
|
Test build #105368 has finished for PR 24592 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. Merged to master. Thank you, @wangyum .
cc @gatorsmile .
| val (mvs, others) = allTables.asScala.map(t => client.getTable("default", t)) | ||
| .partition(_.getTableType.toString.equals("MATERIALIZED_VIEW")) | ||
|
|
||
| // Remove materialized view first, otherwise caused a violation of foreign key constraint. |
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.
Do we have the same issue for Hive indexes? Also, we normally also added a test case in the Version Suite. You can do it by using the method runSqlHive(sql: String) to create materialized views.
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.
Test in another PR: #23992
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.
This issue only occurs with materialized views in Hive 3.1.
I have tested the index and the view.
What changes were proposed in this pull request?
We should remove materialized view first otherwise(note that Hive 3.1 could reproduce this issue):
How was this patch tested?
Existing test