myg821561935 opened a new pull request, #6631:
URL: https://github.com/apache/hive/pull/6631

   Supersedes #6628. GitHub closed the earlier PR automatically when its source 
branch was renamed; the commit itself is unchanged.
   
   ### What changes were proposed in this pull request?
   
   Keep the `Partition` objects returned by HMS in the single-partition and 
batch dynamic-partition load paths. The batch path now requests the partitions 
returned by `add_partitions` and uses them in the result map.
   
   On the metastore side, preserve the existing partition `createTime` when an 
alter request carries an unset or non-positive value. This covers single, 
rename, and batch alter paths.
   
   Regression tests were added for both the load and alter cases.
   
   ### Why are the changes needed?
   
   HMS assigns server-owned fields such as `createTime` when a partition is 
added. The load path currently discards the partition returned by HMS and keeps 
using the request-side object, whose `createTime` is still zero. A later 
statistics update can send that object through `alter_partition` and overwrite 
the value stored by HMS with zero.
   
   This makes the partition creation time unreliable for retention and 
lifecycle management.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. A newly created partition keeps the creation time assigned by HMS 
instead of having it reset to zero by a later alter operation. There is no 
public API change.
   
   ### How was this patch tested?
   
   - `TestHiveLoadPartitionKeepExisting`: 5 tests passed, including the new 
static and dynamic partition cases.
   - `TestAlterPartitions`: 154 tests passed, including the new single and 
batch alter cases.
   - The related 21-module Maven reactor completed successfully with JDK 21.
   
   JIRA: https://issues.apache.org/jira/browse/HIVE-28757


-- 
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