[ https://issues.apache.org/jira/browse/HIVE-25707?focusedWorklogId=835160&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-835160 ]
ASF GitHub Bot logged work on HIVE-25707: ----------------------------------------- Author: ASF GitHub Bot Created on: 22/Dec/22 00:01 Start Date: 22/Dec/22 00:01 Worklog Time Spent: 10m Work Description: DanielZhu58 opened a new pull request, #3863: URL: https://github.com/apache/hive/pull/3863 ### What changes were proposed in this pull request? We only commit when all the changes in schema upgrade is successful. Otherwise, we do not commit. ### Why are the changes needed? Currently, as schematool applies schema changes during an upgrade, each change is autocommitted. So if it fails after applying a few changes from an upgrade file, those changes remain in the schema. So re-running the schematool fails at the first line because that change already exists. Instead, we should create a transactional boundary between each upgrade file, aka commit only after all the changes in an upgrade file are successful. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Maven build and unit test. Issue Time Tracking ------------------- Worklog Id: (was: 835160) Time Spent: 1h (was: 50m) > SchemaTool may leave the metastore in-between upgrade steps > ----------------------------------------------------------- > > Key: HIVE-25707 > URL: https://issues.apache.org/jira/browse/HIVE-25707 > Project: Hive > Issue Type: Bug > Reporter: Zoltan Haindrich > Priority: Major > Labels: pull-request-available > Time Spent: 1h > Remaining Estimate: 0h > > it seems like: > * schematool runs the sql files via beeline > * autocommit is turned on > * pressing ctrl+c or killing the process will result in an invalid schema > https://github.com/apache/hive/blob/6e02f6164385a370ee8014c795bee1fa423d7937/beeline/src/java/org/apache/hive/beeline/schematool/HiveSchemaTool.java#L79 -- This message was sent by Atlassian Jira (v8.20.10#820010)