You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2020/07/09 07:18:03 UTC
[spark] branch branch-3.0 updated: [SPARK-32193][SQL][DOCS] Update
regexp usage in SQL docs
This is an automated email from the ASF dual-hosted git repository.
yamamuro pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 29e098b [SPARK-32193][SQL][DOCS] Update regexp usage in SQL docs
29e098b is described below
commit 29e098bc08477f00b5f83dfc5e73181668bb5f20
Author: GuoPhilipse <46...@users.noreply.github.com>
AuthorDate: Thu Jul 9 16:14:33 2020 +0900
[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 <46...@users.noreply.github.com>
Co-authored-by: GuoPhilipse <gu...@126.com>
Signed-off-by: Takeshi Yamamuro <ya...@apache.org>
(cherry picked from commit 09cc6c51eaa489733551e0507d129b06d683207c)
Signed-off-by: Takeshi Yamamuro <ya...@apache.org>
---
docs/sql-ref-syntax-qry-select-like.md | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/docs/sql-ref-syntax-qry-select-like.md b/docs/sql-ref-syntax-qry-select-like.md
index feb5eb7..6211faa8 100644
--- a/docs/sql-ref-syntax-qry-select-like.md
+++ b/docs/sql-ref-syntax-qry-select-like.md
@@ -26,7 +26,7 @@ A LIKE predicate is used to search for a specific pattern.
### Syntax
```sql
-[ NOT ] { LIKE search_pattern [ ESCAPE esc_char ] | RLIKE regex_pattern }
+[ NOT ] { LIKE search_pattern [ ESCAPE esc_char ] | [ RLIKE | REGEXP ] regex_pattern }
```
### Parameters
@@ -44,7 +44,7 @@ A LIKE predicate is used to search for a specific pattern.
* **regex_pattern**
- Specifies a regular expression search pattern to be searched by the `RLIKE` clause.
+ Specifies a regular expression search pattern to be searched by the `RLIKE` or `REGEXP` clause.
### Examples
@@ -90,6 +90,14 @@ SELECT * FROM person WHERE name RLIKE 'M+';
|200|Mary|null|
+---+----+----+
+SELECT * FROM person WHERE name REGEXP 'M+';
++---+----+----+
+| id|name| age|
++---+----+----+
+|300|Mike| 80|
+|200|Mary|null|
++---+----+----+
+
SELECT * FROM person WHERE name LIKE '%\_%';
+---+------+---+
| id| name|age|
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org