You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2021/01/08 02:56:21 UTC
[spark] branch branch-3.1 updated: [SPARK-33818][SQL][DOC] Add
descriptions about `spark.sql.parser.quotedRegexColumnNames` in the SQL
documents
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 78d29fe [SPARK-33818][SQL][DOC] Add descriptions about `spark.sql.parser.quotedRegexColumnNames` in the SQL documents
78d29fe is described below
commit 78d29feca632d000783d7a1293bf164e19277fb9
Author: angerszhu <an...@gmail.com>
AuthorDate: Thu Jan 7 18:55:27 2021 -0800
[SPARK-33818][SQL][DOC] Add descriptions about `spark.sql.parser.quotedRegexColumnNames` in the SQL documents
### What changes were proposed in this pull request?
According to https://github.com/apache/spark/pull/30805#issuecomment-747179899,
doc `spark.sql.parser.quotedRegexColumnNames` since we need user know about this in doc and it's useful.
![image](https://user-images.githubusercontent.com/46485123/103656543-afa4aa80-4fa3-11eb-8cd3-a9d1b87a3489.png)
![image](https://user-images.githubusercontent.com/46485123/103656551-b2070480-4fa3-11eb-9ce7-95cc424242a6.png)
### Why are the changes needed?
Complete doc
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Not need
Closes #30816 from AngersZhuuuu/SPARK-33818.
Authored-by: angerszhu <an...@gmail.com>
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
(cherry picked from commit 9b54da490d55d8c12e0a6b2b4b6e3a2d5b6bed86)
Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
docs/sql-ref-syntax-qry-select.md | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs/sql-ref-syntax-qry-select.md b/docs/sql-ref-syntax-qry-select.md
index bac7c2b..5820a5c 100644
--- a/docs/sql-ref-syntax-qry-select.md
+++ b/docs/sql-ref-syntax-qry-select.md
@@ -41,7 +41,7 @@ select_statement [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select_stat
While `select_statement` is defined as
```sql
-SELECT [ hints , ... ] [ ALL | DISTINCT ] { named_expression [ , ... ] }
+SELECT [ hints , ... ] [ ALL | DISTINCT ] { [ named_expression | regex_column_names ] [ , ... ] }
FROM { from_item [ , ... ] }
[ PIVOT clause ]
[ LATERAL VIEW clause ] [ ... ]
@@ -151,6 +151,18 @@ SELECT [ hints , ... ] [ ALL | DISTINCT ] { named_expression [ , ... ] }
Specifies aliases for one or more source window specifications. The source window specifications can
be referenced in the widow definitions in the query.
+
+* **regex_column_names**
+
+ When `spark.sql.parser.quotedRegexColumnNames` is true, quoted identifiers (using backticks) in `SELECT`
+ statement are interpreted as regular expressions and `SELECT` statement can take regex-based column specification.
+ For example, below SQL will only take column `c`:
+
+ ```sql
+ SELECT `(a|b)?+.+` FROM (
+ SELECT 1 as a, 2 as b, 3 as c
+ )
+ ```
### Related Statements
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org