shubhammittal92 opened a new pull request, #1058:
URL: https://github.com/apache/incubator-xtable/pull/1058

   Fixes #975
   
   ## What is the purpose of the pull request
   
   When Paimon is the source, a table partitioned by a non-STRING column failed 
to sync to Delta and Iceberg.
   
   `PaimonPartitionExtractor.toPartitionValues` wrapped the raw partition-path 
strings from `InternalRowPartitionComputer.generatePartValues` directly in 
`Range.scalar`, so every partition value reached the targets as a `String`. The 
Delta and Iceberg targets expect the typed form the other sources produce (an 
`Integer` epoch day for `DATE`, an `Integer` for `INT`, a `Long` for `BIGINT`), 
so for a `DATE`/`INT`/`BIGINT` partition the sync failed with:
   
   ```
   java.lang.ClassCastException: Cannot cast java.lang.String to 
java.lang.Integer
   ```
   
   A null partition value also reached the targets as the string 
`__DEFAULT_PARTITION__` instead of `null`.
   
   ## Brief change log
   
   - Convert each Paimon partition value to its typed form based on the 
partition field's `InternalType`, reusing 
`DeltaValueConverter.convertFromDeltaPartitionValue` — the same converter 
`DeltaKernelPartitionExtractor` already reuses outside the `delta` package, 
which keeps Paimon's partition values consistent with the other sources.
   - Map the configured default-partition name 
(`table.coreOptions().partitionDefaultName()`) back to `null`.
   - Added unit tests for `DATE`/`INT`/`LONG`/`STRING` typing and for the null 
/ default-partition sentinel.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - Added `testConvertPartitionValueProducesTypedValues` (asserts 
`DATE`→epoch-day `Integer`, `INT`→`Integer`, `LONG`→`Long`, `STRING`→`String`) 
and `testConvertPartitionValueMapsNullAndDefaultPartitionToNull`.
   - The existing real partitioned-table test 
(`testToPartitionValuesWithPartitionedTable`, STRING partition) continues to 
pass, confirming no regression on the common case.
   - `spotless:check` is clean.
   
   Originally reported in #869.
   


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