Skip to content

Commit

Permalink
[SPARK-37508][SQL][DOCS][FOLLOW-UP] Update expression desc of `CONTAI…
Browse files Browse the repository at this point in the history
…NS()` string function

### What changes were proposed in this pull request?
 Update usage doc of `CONTAINS()` string function to
```
_FUNC_(left, right) - Returns a boolean. The value is True if right is found inside left.
    Returns NULL if either input expression is NULL. Otherwise, returns False.
```
To clarify that when left and right expression both not `NULL` and if right is not found inside left, returns `False`

### Why are the changes needed?
Make function description more clear

### Does this PR introduce _any_ user-facing change?
`DESCRIBE FUNCTION EXTENDED contains`'s usage now return:

```
contains(left, right) - Returns a boolean. The value is True if right is found inside left.
    Returns NULL if either input expression is NULL. Otherwise, returns False.
```

### How was this patch tested?
 Verified it after documentation build or SQL command such s DESCRIBE FUNCTION EXTENDED contains.

Closes apache#34786 from AngersZhuuuu/SPARK-37508-FOLLOWUP.

Authored-by: Angerszhuuuu <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
  • Loading branch information
AngersZhuuuu authored and HyukjinKwon committed Dec 4, 2021
1 parent b2a4e8f commit b5fc6da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ abstract class StringPredicate extends BinaryExpression
*/
@ExpressionDescription(
usage = """
_FUNC_(expr1, expr2) - Returns a boolean value if expr2 is found inside expr1.
Returns NULL if either input expression is NULL.
_FUNC_(left, right) - Returns a boolean. The value is True if right is found inside left.
Returns NULL if either input expression is NULL. Otherwise, returns False.
""",
examples = """
Examples:
Expand Down

0 comments on commit b5fc6da

Please sign in to comment.