vigneshsiva11 opened a new pull request, #3265:
URL: https://github.com/apache/datafusion-comet/pull/3265
## Which issue does this PR close?
Closes #3180
## Rationale for this change
Spark `TimestampNTZ` values represent local time without any timezone
information. However, the current Comet implementation applies timezone
conversion when evaluating `hour`, `minute`, and `second`, which leads to
incorrect results for `TimestampNTZ` inputs in non-UTC session timezones.
This change aligns Comet behavior with Spark semantics by ensuring that
timezone conversion is only applied to `Timestamp` values with an explicit
timezone, and not to `TimestampNTZ`.
## What changes are included in this PR?
- Updated the Rust implementation of `extract_date_part` used by
`hour`, `minute`, and `second` to:
- Bypass timezone conversion for `TimestampNTZ` inputs
- Preserve existing behavior for `Timestamp` inputs with timezone
- Added defensive handling for unsupported input types
## How are these changes tested?
- Verified via Rust unit tests:
```bash
cargo test -p datafusion-comet-spark-expr
--
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]