You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/23 09:14:59 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #30442: [SPARK-33498][SQL] Datetime parsing should fail if the input string can't be parsed, or the pattern string is invalid
cloud-fan commented on a change in pull request #30442:
URL: https://github.com/apache/spark/pull/30442#discussion_r528557886
##########
File path: docs/sql-ref-ansi-compliance.md
##########
@@ -136,12 +136,17 @@ The behavior of some SQL functions can be different under ANSI mode (`spark.sql.
- `element_at`: This function throws `NoSuchElementException` if key does not exist in map.
- `elt`: This function throws `ArrayIndexOutOfBoundsException` if using invalid indices.
- `parse_url`: This function throws `IllegalArgumentException` if an input string is not a valid url.
+ - `to_date` This function should fail with an exception if the input string can't be parsed, or the pattern string is invalid.
+ - `to_timestamp` This function should fail with an exception if the input string can't be parsed, or the pattern string is invalid.
+ - `unix_timestamp` This function should fail with an exception if the input string can't be parsed, or the pattern string is invalid.
+ - `to_unix_timestamp` This function should fail with an exception if the input string can't be parsed, or the pattern string is invalid.
### SQL Operators
The behavior of some SQL operators can be different under ANSI mode (`spark.sql.ansi.enabled=true`).
- `array_col[index]`: This operator throws `ArrayIndexOutOfBoundsException` if using invalid indices.
- `map_col[key]`: This operator throws `NoSuchElementException` if key does not exist in map.
+ - `cast to timestamp`: This operator should fail with an exception if the input string can't be parsed.
Review comment:
nit: `CAST(string_col AS TIMESTAMP)` to be user-facing.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org