zhengruifeng commented on code in PR #58385:
URL: https://github.com/apache/spark/pull/58385#discussion_r3892941920


##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -16567,6 +17106,12 @@ object functions {
    * @since 4.1.0
    * @return
    *   Returns a column that evaluates to a timestamp.
+   *
+   * @note
+   *   Affected by these public SQL configurations:
+   *   - `spark.sql.ansi.enabled`

Review Comment:
   Good catch. I traced each arity through the timestamp expression builders 
and updated the Scala notes per overload in f2ffca7bf8e. Explicit-timezone 
forms no longer list the session time zone; the date/time constructors no 
longer list ANSI or timestamp type; `make_timestamp_ntz(date, time)` and 
no-argument `unix_timestamp()` no longer have config notes. I applied the same 
corrections to the analogous `try_make_timestamp*` overloads. Python exposes 
one docstring for all typing overloads, so it retains the union of configs that 
can affect at least one supported call form.



##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -13124,6 +13403,10 @@ object functions {
    * @since 3.5.0
    * @return
    *   Returns a column that evaluates to a timestamp.
+   *
+   * @note
+   *   Affected by these public SQL configurations:
+   *   - `spark.sql.session.timeZone`

Review Comment:
   Confirmed. Both LTZ and NTZ builders construct `ParseToTimestamp`, whose 
default `failOnError` is `SQLConf.get.ansiEnabled`. In f2ffca7bf8e I added 
`spark.sql.ansi.enabled` to both Scala overloads of `to_timestamp_ltz` and 
`to_timestamp_ntz`, and to both Python docstrings. I also clarified that 
invalid input returns null only with ANSI disabled and raises an error 
otherwise.



##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -1724,6 +1736,10 @@ object functions {
    * @since 1.3.0
    * @return
    *   Returns a column that evaluates to a numeric or interval.
+   *
+   * @note
+   *   Affected by these public SQL configurations:
+   *   - `spark.sql.ansi.enabled`

Review Comment:
   Confirmed all of these paths: `mean` resolves to `Average`; `sum_distinct` 
and `sumDistinct` resolve to `Sum`; `negative` and `negate` resolve to 
`UnaryMinus`; and `pmod` uses `NumericEvalContext`, all of which read ANSI 
mode. `TryReflect` wraps `CallMethodViaReflection`, whose analysis still 
enforces `spark.sql.reflect.allowList`. I added the Scala and Python notes in 
f2ffca7bf8e; the Python `negate` alias shares `negative`'s docstring.



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