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

   ## Which issue does this PR close?
   
   Closes #5366.
   
   ## Rationale for this change
   
   Spark accepts `to_time('T12')` and `to_time('12:30:45.')`, but Comet rejects 
them or returns NULL with `try_to_time`. Match Spark's parser and let 
fractional-second extraction run in Rust so precision checks also exercise the 
native parser.
   
   ## What changes are included in this PR?
   
   - Accept hour-only values with a `T` prefix and empty fractional seconds in 
the shared time parser; retain rejection of malformed inputs.
   - Add native `EXTRACT(SECOND FROM TIME)` for Spark's `Decimal(8,6)` result, 
preserving NULLs and truncating to input precisions 0–6. Guard the mapping 
against incompatible result types in newer Spark versions.
   - Handle non-NULL TIME literals in the native planner and update the 
expression documentation.
   - Preserve Spark 4.1's six-digit parsing precision, verified against Spark 
4.1.3. Add SQL coverage with JVM codegen dispatch disabled to verify Rust 
execution.
   
   The `implement-comet-expression` workflow was used for the native extraction 
addition.
   
   ## How are these changes tested?
   
   - Targeted Rust tests: 18 time-parser tests and 2 fractional-second 
extraction tests.
   - Spark 4.1.3 SQL fixtures: `to_time.sql` and `extract_time.sql`, including 
input precisions 0–6, NULLs, boundaries, and malformed strings. The extraction 
fixture disables JVM codegen dispatch.
   - Native build, JVM compilation, formatting checks, and workspace Clippy 
with warnings denied.
   


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