jianguotian opened a new pull request, #10463:
URL: https://github.com/apache/paimon/pull/10463

   ### Purpose
   
   Fix partition expiration for `DATE` partition columns.
   
   `RowDataToObjectArrayConverter` exposes a `DATE` value as its internal 
epoch-day integer. With `values-time`, an ISO date such as `2026-03-11` becomes 
`20523`, fails timestamp parsing, and is excluded from expiration after a 
warning.
   
   Normalize non-null `DATE` values to `LocalDate` for time extraction. When 
generating partition deletion specs, use the configured partition serializer 
for DATE fields so both the default legacy epoch-day names and ISO date names 
match the registered metastore partitions. This preserves ordinary `INTEGER` 
partition values and existing null/empty-string handling. No new configuration 
or on-disk layout change is required.
   
   Document the `yyyy-MM-dd` representation used for typed date partitions and 
clarify that `values-time` uses the partition value, not the partition creation 
time.
   
   The test metastore adapter ignores absent synthetic `.done` entries and 
removes matched registered entries, allowing the tests to assert that both data 
and partition metadata are cleaned up.
   
   Related PR: https://github.com/jianguotian/paimon/pull/17
   
   ### Tests
   
   Built and tested with JDK 8 at source commit 
`71dc3649514a9c8089f55fca238b21a466dcf42e` and again on a local merge with 
`apache/paimon:master` at `ff2f1cec131542965c57e6808b8d5e8e95be8125`. The merge 
is conflict-free, and its diff against upstream master is identical to the 
original change plus the cleanup fix.
   
   - The new default-legacy DATE + STRING regression test failed before the 
cleanup fix for both `values-time` and `update-time`: data was removed but the 
epoch-day partition metadata remained.
   - All **29 focused tests passed**, with no failures, errors, or skipped 
tests, across `PartitionExpireTest`, `PartitionTimeExtractorTest`, and 
`PartitionExpireTableTest`.
   - Coverage includes pre-epoch and epoch dates, leap day, ISO formatters, 
implicit and explicit timestamp patterns, null date values, ordinary integer 
date partitions, mixed date/hour partitions, both expiration strategies, legacy 
and ISO naming, and metastore partition callbacks.
   - Expiration tests verify generated partition specs, remaining metadata, and 
actual remaining rows; the `values-time` cases retain the unexpired partition.
   - Checkstyle, Spotless, and the configured Maven validation checks passed in 
the final test run without the `fast-build` profile. `git diff --check` passed.
   
   ```bash
   mvn -B -pl paimon-core -am -Pfast-build -DskipTests package
   mvn -B -pl paimon-core -am -DfailIfNoTests=false \
     
-Dtest=PartitionExpireTest,PartitionTimeExtractorTest,PartitionExpireTableTest \
     -DwildcardSuites=none test
   ```
   


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