Skip to content

Commit

Permalink
update doc.
Browse files Browse the repository at this point in the history
Change-Id: Ic592678e4452f550b2c645be9cba5cac1c009b82
  • Loading branch information
leanken-zz committed Nov 16, 2020
1 parent d830d14 commit 2649359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/sql-ref-ansi-compliance.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ 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.
- `elt`: This function throws `ArrayIndexOutOfBoundsException` if using invalid indices.

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

### SQL Keywords

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,9 @@ case class ArrayPosition(left: Expression, right: Expression)
If `spark.sql.ansi.enabled` is set to true, it throws ArrayIndexOutOfBoundsException
for invalid indices.
_FUNC_(map, key) - Returns value for given key, or NULL if the key is not contained in the map
_FUNC_(map, key) - Returns value for given key. The function returns NULL
if the key is not contained in the map and `spark.sql.ansi.enabled` is set to false.
If `spark.sql.ansi.enabled` is set to true, it throws NoSuchElementException instead.
""",
examples = """
Examples:
Expand Down

0 comments on commit 2649359

Please sign in to comment.