peterxcli opened a new pull request, #5172:
URL: https://github.com/apache/datafusion-comet/pull/5172

   > [!IMPORTANT]
   > **Stacked dependency:** This PR depends on 
[#5130](https://github.com/apache/datafusion-comet/pull/5130) by @andygrove. It 
is based on 
[`e14e086`](https://github.com/andygrove/datafusion-comet/commit/e14e086a5c867ae5cb624a1df59004ff750aa6dd)
 and relies on the classifier and Spark test port introduced there. Please 
review this PR as the single fix commit on top of #5130; it will be rebased 
after #5130 merges.
   
   ## Which issue does this PR close?
   
   Closes #5165.
   
   ## Rationale for this change
   
   Andy's Spark `DateTimeUtilsSuite` port in #5130 exposed two 
string-to-timestamp differences tracked by #5165: leading and trailing C0/DEL 
control characters are not trimmed, and malformed leading `+` inputs return 
null under ANSI instead of raising `CAST_INVALID_INPUT`.
   
   ## What changes are included in this PR?
   
   - Reuse one whitespace-or-ISO-control predicate for DATE, TIMESTAMP, and 
TIMESTAMP_NTZ parsing.
   - Trim leading and trailing ASCII whitespace and C0/DEL controls in both 
timestamp parsers while preserving existing empty/whitespace-only behavior.
   - Preserve Spark's version-specific handling of padded `T`-prefixed 
time-only values.
   - Route malformed leading `+` values through the existing mode-aware 
invalid-input paths. Legacy and Try still return null; ANSI now raises 
`CAST_INVALID_INPUT`. Valid `+<year>-...` input remains accepted.
   - Remove both #5165 carve-outs from the ported Spark tests and add 
TIMESTAMP_NTZ coverage.
   
   ## How are these changes tested?
   
   - `cd native && cargo test -p datafusion-comet-spark-expr --lib` — 545 
passed.
   - `cd native && cargo test -p datafusion-comet-spark-expr --lib 
spark_string_to_timestamp` — 4 passed.
   - `cd native && cargo fmt --all -- --check`
   - `git diff --check upstream/pr/5130`
   


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

Reply via email to