peterxcli commented on PR #5177: URL: https://github.com/apache/datafusion-comet/pull/5177#issuecomment-5154801152
@andygrove thanks for the review! > 1. Micros → millis rounding Changed this one conversion back to a small custom kernel because Arrow truncates negative values toward zero, while Spark uses floor division. - Before: `-1_500_001 / 1_000 = -1500` - Now: `-1_500_001.div_euclid(1_000) = -1501` > 2. Millis → micros cast options for `array_with_timezone` in `utils.rs` Changed `CastOptions::default()` (`safe: true`) to DataFusion’s `DEFAULT_CAST_OPTIONS` (`safe: false`). This means Arrow: (1.) Reuses the existing null buffer. (2.) Returns an error on multiplication overflow, matching Spark’s `Math.multiplyExact`. (3. ) No longer silently converts overflowed values to `NULL`. I also added a regression assertion using `i64::MAX` to confirm overflow returns an error. ref: https://github.com/apache/spark/blob/v4.2.0/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala#L969-L972 > 3. `date_from_unix_date` option consistency Changed to use `DEFAULT_CAST_OPTIONS`. 4. `cast_column.rs` test coverage Expanded the array test to cover all three relevant timezone layouts: - No timezone → no timezone - No timezone → `+07:00` - `UTC` → `America/New_York` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
