JingsongLi commented on code in PR #10851:
URL: https://github.com/apache/paimon/pull/10851#discussion_r4479188379


##########
paimon-core/src/main/java/org/apache/paimon/operation/NormalPartitionExpire.java:
##########
@@ -161,14 +160,15 @@ private List<Map<String, String>> doExpire(
         List<List<String>> expiredPartValues = new 
ArrayList<>(partitionEntries.size());
         for (PartitionEntry partition : partitionEntries) {
             Object[] array = strategy.convertPartition(partition.partition());
-            // DATE values are normalized for time extraction; use the stored 
names for dropping.
+            // DATE and TIMESTAMP values are normalized for time extraction; 
use the stored
+            // names for dropping.
             Map<String, String> partitionSpec =
                     commit.pathFactory()
                             .partitionComputer()
                             .generatePartValues(partition.partition());
             int index = 0;
             for (String value : partitionSpec.values()) {
-                if (array[index] instanceof LocalDate) {
+                if (array[index] != null && 
strategy.isNormalizedForTimeExtraction(index)) {
                     array[index] = value;

Review Comment:
   [P1] Preserve the selected typed partition key when deleting locally. The 
generated path spelling is not always safe to parse back as a partition spec. 
With current names, `partition.default-name='1970-01-01 00:00:00'`, an NTZ 
epoch partition, a NULL partition, and the existing ISO custom formatter, this 
head selects the epoch partition but deletes the NULL row. The same test 
against the base deletes epoch and retains NULL. A second real-table case uses 
`(NTZ, LTZ)` keys, the default extractor, New York timezone, and an expiration 
cap of 1. It reports the LTZ `00:00Z` partition but deletes the `05:00Z` 
partition because the LTZ ISO string is reparsed in local time. Keep stored/HMS 
names separate from the original `BinaryRow` used for local deletion, and cover 
both readback cases.



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

Reply via email to