HIVE-28352: Schematool fails to upgradeSchema on dbType=hive - #5324
Merged
Conversation
okumin
commented
Jun 27, 2024
| @@ -160,20 +160,20 @@ CREATE OR REPLACE VIEW `COMPACTIONS` | |||
| `C_TBLPROPERTIES` | |||
| ) AS | |||
| SELECT | |||
Contributor
Author
There was a problem hiding this comment.
The original DDL was invalid. I copied the non-upgrade DDL.
Error: Error while compiling statement: FAILED: SemanticException Schema of both sides of union should match. (state=42000,code=40000)
2024-06-27T02:42:12,201 ERROR [main] schematool.MetastoreSchemaTool: Upgrade FAILED! Metastore state would be inconsistent !!
Upgrade FAILED! Metastore state would be inconsistent !!
2024-06-27T02:42:12,201 ERROR [main] schematool.MetastoreSchemaTool: Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
2024-06-27T02:42:12,201 ERROR [main] schematool.MetastoreSchemaTool: Use --verbose for detailed stacktrace.
Use --verbose for detailed stacktrace.
2024-06-27T02:42:12,201 ERROR [main] schematool.MetastoreSchemaTool: *** schemaTool failed ***
*** schemaTool failed ***
| DROP TABLE IF EXISTS `VERSION`; | ||
|
|
||
| CREATE OR REPLACE VIEW `VERSION` AS SELECT 1 AS `VER_ID`, '4.1.0' AS `SCHEMA_VERSION`, | ||
| 'Hive release version 4.1.0' AS `VERSION_COMMENT`; |
Contributor
Author
There was a problem hiding this comment.
We need to upgrade this definition. Otherwise, the final validation fails.
Completed upgrade-4.0.0-to-4.1.0.hive.sql
2024-06-27T03:05:43,358 ERROR [main] schematool.MetastoreSchemaTool: Metastore schema version is not compatible. Hive Version: 4.1.0, Database Schema Version: 4.0.0-alpha-1
Metastore schema version is not compatible. Hive Version: 4.1.0, Database Schema Version: 4.0.0-alpha-1
2024-06-27T03:05:43,358 ERROR [main] schematool.MetastoreSchemaTool: Use --verbose for detailed stacktrace.
Use --verbose for detailed stacktrace.
2024-06-27T03:05:43,358 ERROR [main] schematool.MetastoreSchemaTool: *** schemaTool failed ***
dengzhhu653
approved these changes
Jun 27, 2024
deniskuzZ
reviewed
Jun 27, 2024
deniskuzZ
reviewed
Jun 27, 2024
deniskuzZ
approved these changes
Jun 28, 2024
|
Contributor
Author
|
Thank you, both, for your reviews |
dengzhhu653
pushed a commit
to dengzhhu653/hive
that referenced
this pull request
Jul 18, 2024
…Okumiya, reviewed by Zhihua Deng, Denys Kuzmenko) Closes apache#5324
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changes were proposed in this pull request?
Make it possible to migrate the tables schemas in
hive.sys.https://issues.apache.org/jira/browse/HIVE-28352
Why are the changes needed?
The migration script doesn't succeed.
Does this PR introduce any user-facing change?
No. It is a bug fix and the current scripts never succeed for users.
Is the change a dependency upgrade?
No.
How was this patch tested?
I tested the migration from 3.0.0 to the 4.1.0.