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

   ## What is the purpose of the pull request
   
   When a Delta table is partitioned by a composite (generated column) partition
   — e.g. `year`/`month`/`day` columns derived from a single source column — the
   partition extractor joins the component values with 
`Collectors.joining("-")`.
   If one of the component values is missing from the partition values map, the
   missing value was rendered as the literal string `"null"`, producing a
   corrupted partition value such as `"2013-null-20"` that was then fed to the
   date parser.
   
   This affects both the Spark-based `DeltaPartitionExtractor` and the
   `DeltaKernelPartitionExtractor`, which contained identical logic.
   
   ## Brief change log
   
   - `DeltaPartitionExtractor#getSerializedPartitionValue`: return `null` when 
any
     component value of a composite partition is missing, consistent with the
     single-field branch that uses `getOrDefault(name, null)`.
   - `DeltaKernelPartitionExtractor#getSerializedPartitionValue`: apply the same
     fix.
   - Added regression tests in `TestDeltaPartitionExtractor` and
     `TestDeltaKernelPartitionExtractor` covering a composite generated-column
     partition with a missing component.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - Added `testGeneratedPartitionValueExtractionWithMissingComponent` to both
     `TestDeltaPartitionExtractor` and `TestDeltaKernelPartitionExtractor`,
     asserting the partition value resolves to `null` instead of a value
     containing the literal `"null"`.
   - Verified locally: `Tests run: 13, Failures: 0, Errors: 0` for both test
     classes.


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