markonik-db commented on code in PR #48624:
URL: https://github.com/apache/spark/pull/48624#discussion_r1820567637
##########
docs/sql-ref-ansi-compliance.md:
##########
@@ -380,6 +380,10 @@ When ANSI mode is on, it throws exceptions for invalid
operations. You can use t
- `try_element_at`: identical to the function `element_at`, except that it
returns `NULL` result instead of throwing an exception on array's index out of
bound.
- `try_to_timestamp`: identical to the function `to_timestamp`, except that
it returns `NULL` result instead of throwing an exception on string parsing
error.
- `try_parse_url`: identical to the function `parse_url`, except that it
returns `NULL` result instead of throwing an exception on url parsing error.
+ - `try_make_timestamp`: identical to the function `make_timestamp`, except
that it returns `NULL` result instead of throwing an exception on string
parsing error.
+ - `try_make_timestamp_ltz`: identical to the function `make_timestamp_ltz`,
except that it returns `NULL` result instead of throwing an exception on string
parsing error.
+ - `try_make_timestamp_ntz`: identical to the function `make_timestamp_ntz`,
except that it returns `NULL` result instead of throwing an exception on string
parsing error.
Review Comment:
removed the string parsing part
##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -8119,6 +8119,41 @@ object functions {
secs: Column): Column =
Column.fn("make_timestamp", years, months, days, hours, mins, secs)
+ /**
+ * Try to create a timestamp from years, months, days, hours, mins, secs and
timezone fields.
+ * The result data type is consistent with the value of configuration
`spark.sql.timestampType`.
+ * The function returns NULL on invalid inputs.
+ *
+ * @group datetime_funcs
+ * @since 4.0.0
+ */
+ def try_make_timestamp(
+ years: Column,
+ months: Column,
+ days: Column,
+ hours: Column,
+ mins: Column,
+ secs: Column,
+ timezone: Column): Column =
+ Column.fn("try_make_timestamp", years, months, days, hours, mins, secs,
timezone)
+
+ /**
+ * ANSI-compliant version of the make_timestamp function. Try to create a
timestamp from years,
Review Comment:
removed
--
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]