Indian-boult opened a new pull request, #1020:
URL: https://github.com/apache/incubator-xtable/pull/1020

   Fixes #1019
   
   ## What is the purpose of the pull request
   
   The Delta Standalone target, the default Delta target, wrote timestamp 
column stats as `yyyy-MM-dd HH:mm:ss` in UTC. Delta readers skip files with 
these stats. The max could be up to 999 ms below the true max, and Spark read 
the `TIMESTAMP` stats in its session time zone, so filters near the min or max 
skipped files with matching rows. This PR writes the stats the way Spark Delta 
and Delta Kernel do.
   
   ## Brief change log
   
   - `DeltaValueConverter`: `TIMESTAMP` stats are written as 
`2026-11-14T00:39:18.926Z` and `TIMESTAMP_NTZ` stats as 
`2026-11-14T00:39:18.926`. Micros are rounded down to millis, as Spark Delta 
does. Delta readers add 1 ms to the max.
   - `DeltaValueConverter`: a stat without an offset is read as UTC, so the 
Delta source can read the new `TIMESTAMP_NTZ` stats and the ones Spark Delta 
3.x writes. The old format still parses.
   - `TestDeltaValueConverter`: new cases for millis, micros, `TIMESTAMP_NTZ`, 
a value before 1970, and parsing. Existing expected values in 
`TestDeltaValueConverter`, `TestDeltaStatsExtractor` and 
`TestDeltaKernelStatsExtractor` use the new format.
   - `ITDeltaConversionTarget`: syncs an Iceberg table to the Delta target and 
checks that Spark Delta reads with filters just inside the timestamp min and 
max return the same rows as the source, in the UTC, Asia/Kolkata and 
America/Los_Angeles session time zones.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - `ITDeltaConversionTarget` fails on `main` (0 rows against 1 from the 
source) in all three time zones and passes with the fix.
   - `TestDeltaValueConverter#timestampStatsKeepMilliseconds` and 
`#parseTimestampStats` fail on `main` and pass with the fix.
   - `./mvnw -pl xtable-core test`: 591 run, 0 failures, 3 skipped.
   - `ITConversionController` (80), `ITDeltaConversionSource`, 
`ITDeltaKernelConversionSource` and `ITDeltaDeleteVectorConvert` pass.
   
   Tables already written by the Delta target keep the old stats on files that 
were already synced. Deleting the target `_delta_log` and running a full sync 
rewrites them.


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