MaxGekk opened a new pull request, #56771:
URL: https://github.com/apache/spark/pull/56771

   ### What changes were proposed in this pull request?
   
   This PR completes the user-facing SQL reference documentation for the `TIME` 
data type:
   
   - `docs/sql-ref-datatypes.md`: add the missing `TimeType` rows to the Python 
(`datetime.time` / `TimeType()`), R (`Not supported`), and SQL type-name 
(`TIME, TIME(p)`) tables, and update the `TimeType(precision)` description to 
reflect the supported precision range (`0` to `9`, default `6`).
   - `docs/sql-ref-literals.md`: extend the `TIME` literal syntax to allow up 
to 9 fractional-second digits and add a nanosecond-precision example.
   - `docs/sql-ref-ansi-compliance.md`: document that `TIME` does not promote 
to other types, the least common type of `TIME(n)`/`TIME(m)` is `TIME(max(n, 
m))`, and Spark's deviations from the SQL standard (default precision `6` vs 
ANSI `0`; `TIME WITH TIME ZONE` not supported).
   
   The TIME-related functions and operators (`current_time`, `make_time`, 
`to_time`, `try_to_time`, `time_trunc`, `time_diff`, `time_from_*`, 
`time_to_*`, `hour`/`minute`/`second`) are already covered by the 
auto-generated SQL function reference, which is built from the 
`@ExpressionDescription` annotations on the corresponding expressions and 
registered in `FunctionRegistry`.
   
   This PR addresses both 
[SPARK-57030](https://issues.apache.org/jira/browse/SPARK-57030) (data-type 
reference page) and 
[SPARK-57031](https://issues.apache.org/jira/browse/SPARK-57031) 
(functions/operators and ANSI compliance page).
   
   ### Why are the changes needed?
   
   To finish documenting the `TIME` data type and its functions/operators and 
ANSI behavior in the SQL reference.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Documentation-only changes.
   
   ### How was this patch tested?
   
   Reviewed the rendered Markdown tables and verified the claims against the 
implementation (`TimeType`, `DataTypeAstBuilder`, the `TIME` literal parser in 
`AstBuilder`, and `FunctionRegistry`).
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor (Claude Opus 4.8)


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