Aggarwal-Raghav commented on code in PR #6992:
URL: https://github.com/apache/hive/pull/6992#discussion_r4742942284


##########
standalone-metastore/metastore-server/src/main/sql/hive/upgrade-4.1.0-to-4.2.0.hive.sql:
##########
@@ -56,4 +58,7 @@ TBLPROPERTIES (
   
'proto.class'='org.apache.tez.dag.history.logging.proto.HistoryLoggerProtos$ManifestEntryProto'
 );
 
+CREATE OR REPLACE VIEW `VERSION` AS SELECT 1 AS `VER_ID`, '4.2.0' AS 
`SCHEMA_VERSION`,

Review Comment:
   I have added a UT based on following params, let me know if any changes are 
required, open to feedback:
   1. I compared the fresh installed `hive-schema-4.2.0.hive.sql` vs 
`upgrade-4.1.0-to-4.2.0.hive.sql` where fresh installed one is expected/golden 
file.
   2. I captured the `primary key constraints, serde and table properties, 
view's original text in sorted order, trimmed whitespace (normalize) and 
hive.sql.query for JdbcSerDe` in order to compare the Metastore Schema of 
expected vs Actual.
   3. I've manually introduced some column diff and serde diff to test that 
functionality the error logs are attached for reference along with how TableDef 
looks
   
[column_diff.txt](https://github.com/user-attachments/files/35631816/column_diff.txt)
   
[serde_diff.txt](https://github.com/user-attachments/files/35631818/serde_diff.txt)
   
[table_def_log.txt](https://github.com/user-attachments/files/35631817/table_def_log.txt)
   
   And without PR failure:
   ```
   [ERROR] Failures:
   [ERROR]   
TestHiveSchemaToolUpgrade.testUpgrade400To420OnHiveDbType:135->verifyUpgrade:171
 SYS.VERSION mismatch after [upgrade-4.0.0-to-4.1.0.hive.sql, 
upgrade-4.1.0-to-4.2.0.hive.sql] expected:<4.[2].0> but was:<4.[1].0>
   [ERROR]   
TestHiveSchemaToolUpgrade.testUpgrade410To420OnHiveDbType:126->verifyUpgrade:171
 SYS.VERSION mismatch after [upgrade-4.1.0-to-4.2.0.hive.sql] 
expected:<4.[2].0> but was:<4.[1].0>
   [INFO]
   [ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
   ```
   
   This is the sequence diagram for the UT flow. 
   <img width="1112" height="687" alt="Screenshot 2026-11-30 at 10 29 36 PM" 
src="https://github.com/user-attachments/assets/9a7c4818-19e7-40ca-8927-67c5a175c850";
 />



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to