Skip to content

Commit 29e098b

Browse files
GuoPhilipsemaropu
authored andcommitted
[SPARK-32193][SQL][DOCS] Update regexp usage in SQL docs
### What changes were proposed in this pull request? update REGEXP usage and examples in sql-ref-syntx-qry-select-like.cmd ### Why are the changes needed? make the usage of REGEXP known to more users ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? No tests Closes #29009 from GuoPhilipse/update-migrate-guide. Lead-authored-by: GuoPhilipse <[email protected]> Co-authored-by: GuoPhilipse <[email protected]> Signed-off-by: Takeshi Yamamuro <[email protected]> (cherry picked from commit 09cc6c5) Signed-off-by: Takeshi Yamamuro <[email protected]>
1 parent 86efa45 commit 29e098b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/sql-ref-syntax-qry-select-like.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A LIKE predicate is used to search for a specific pattern.
2626
### Syntax
2727

2828
```sql
29-
[ NOT ] { LIKE search_pattern [ ESCAPE esc_char ] | RLIKE regex_pattern }
29+
[ NOT ] { LIKE search_pattern [ ESCAPE esc_char ] | [ RLIKE | REGEXP ] regex_pattern }
3030
```
3131

3232
### Parameters
@@ -44,7 +44,7 @@ A LIKE predicate is used to search for a specific pattern.
4444

4545
* **regex_pattern**
4646

47-
Specifies a regular expression search pattern to be searched by the `RLIKE` clause.
47+
Specifies a regular expression search pattern to be searched by the `RLIKE` or `REGEXP` clause.
4848

4949
### Examples
5050

@@ -90,6 +90,14 @@ SELECT * FROM person WHERE name RLIKE 'M+';
9090
|200|Mary|null|
9191
+---+----+----+
9292

93+
SELECT * FROM person WHERE name REGEXP 'M+';
94+
+---+----+----+
95+
| id|name| age|
96+
+---+----+----+
97+
|300|Mike| 80|
98+
|200|Mary|null|
99+
+---+----+----+
100+
93101
SELECT * FROM person WHERE name LIKE '%\_%';
94102
+---+------+---+
95103
| id| name|age|

0 commit comments

Comments
 (0)