sdf-jkl opened a new pull request, #27316:
URL: https://github.com/apache/datafusion/pull/27316

   ## Which issue does this PR close?
   
   Closes #27271.
   
   ## Rationale for this change
   
   SQL rejects explicit precision on `TIME`, so users cannot name second, 
millisecond, or microsecond time types in casts or column declarations.
   
   ## What changes are included in this PR?
   
   Accept `TIME(p)` for the same precisions supported by `TIMESTAMP(p)`:
   
   | SQL type | Arrow type |
   | --- | --- |
   | `TIME(0)` | `Time32(Second)` |
   | `TIME(3)` | `Time32(Millisecond)` |
   | `TIME(6)` | `Time64(Microsecond)` |
   | `TIME(9)` | `Time64(Nanosecond)` |
   
   Update the SQL type documentation with these mappings.
   
   ## What is the testing strategy for this PR?
   
   Added cases in `datafusion/sqllogictest/test_files/datetime/timestamps.slt` 
cover casts, fractional-second truncation, column declarations, nulls, `WITHOUT 
TIME ZONE`, and rejection of unsupported precisions and time zones. The new 
casts and table declaration fail without the implementation.
   
   Validation passed: 718 SQL crate tests and doctests, 76 datetime/cast SQL 
test files, all repository lint checks, including full workspace Clippy with 
all targets and features and the documentation build. Full workspace tests were 
not run.
   
   ## Are there any user-facing changes?
   
   Yes, `TIME(0/3/6/9)` is now accepted, including with `WITHOUT TIME ZONE`. 
Plain `TIME` remains `Time64(Nanosecond)`. Other precisions, `TIMETZ`, and 
`TIME WITH TIME ZONE` remain unsupported.
   


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