From 9959d49942d334b03a05c43299f3949a48e5fa17 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Wed, 9 Dec 2020 19:47:20 +0900 Subject: [PATCH] [SPARK-33719][DOC] Add make_date/make_timestamp/make_interval into the doc of ANSI Compliance ### What changes were proposed in this pull request? Add make_date/make_timestamp/make_interval into the doc of ANSI Compliance ### Why are the changes needed? Users can know that these functions throw runtime exceptions under ANSI mode if the result is not valid. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Build doc and check it in browser: ![image](https://user-images.githubusercontent.com/1097932/101608930-34a79e80-39bb-11eb-9294-9d9b8c3f6faa.png) Closes #30683 from gengliangwang/improveDoc. Authored-by: Gengliang Wang Signed-off-by: HyukjinKwon --- docs/sql-ref-ansi-compliance.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/sql-ref-ansi-compliance.md b/docs/sql-ref-ansi-compliance.md index c3e17dc22eed0..08ba07aa8de63 100644 --- a/docs/sql-ref-ansi-compliance.md +++ b/docs/sql-ref-ansi-compliance.md @@ -144,14 +144,18 @@ SELECT * FROM t; The behavior of some SQL functions can be different under ANSI mode (`spark.sql.ansi.enabled=true`). - `size`: This function returns null for null input. - - `element_at`: This function throws `ArrayIndexOutOfBoundsException` if using invalid indices. - - `element_at`: This function throws `NoSuchElementException` if key does not exist in map. + - `element_at`: + - This function throws `ArrayIndexOutOfBoundsException` if using invalid indices. + - 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. + - `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. + - `make_date`: This function should fail with an exception if the result date is invalid. + - `make_timestamp`: This function should fail with an exception if the result timestamp is invalid. + - `make_interval`: This function should fail with an exception if the result interval is invalid. ### SQL Operators