You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2024/07/29 14:13:45 UTC

(spark) branch master updated: [SPARK-49040][SQL] Fix doc `sql-ref-syntax-aux-exec-imm.md`

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d4d76463144 [SPARK-49040][SQL] Fix doc `sql-ref-syntax-aux-exec-imm.md`
6d4d76463144 is described below

commit 6d4d76463144c7c493cfd1f3bf5950c803d45f49
Author: panbingkun <pa...@baidu.com>
AuthorDate: Mon Jul 29 10:13:33 2024 -0400

    [SPARK-49040][SQL] Fix doc `sql-ref-syntax-aux-exec-imm.md`
    
    ### What changes were proposed in this pull request?
    The pr aims to fix the sql in the example of the file `sql-ref-syntax-aux-exec-imm.md` cannot be executed
    
    ### Why are the changes needed?
    - Before:
      <img width="1333" alt="image" src="https://github.com/user-attachments/assets/fa980b52-d233-42bf-9f84-cc55e52dbb23">
    
    - After:
      <img width="630" alt="image" src="https://github.com/user-attachments/assets/3b4f4326-b628-464f-a0ef-55e66d315653">
    
    ### Does this PR introduce _any_ user-facing change?
    Yes, the example sql in file `sql-ref-syntax-aux-exec-imm.md` can be copy-paste-run.
    
    ### How was this patch tested?
    Manually test.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #47517 from panbingkun/SPARK-49040.
    
    Authored-by: panbingkun <pa...@baidu.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 docs/sql-ref-syntax-aux-exec-imm.md | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/docs/sql-ref-syntax-aux-exec-imm.md b/docs/sql-ref-syntax-aux-exec-imm.md
index 0d9a0f5b4aa3..904a676605c8 100644
--- a/docs/sql-ref-syntax-aux-exec-imm.md
+++ b/docs/sql-ref-syntax-aux-exec-imm.md
@@ -61,11 +61,11 @@ EXECUTE IMMEDIATE sql_string
 
 ```sql
 -- A self-contained execution using a literal string
-EXECUTE IMMEDIATE 'SELECT SUM(c1) FROM VALUES(?), (?)' USING 5, 6;
+EXECUTE IMMEDIATE 'SELECT SUM(col1) FROM VALUES(?), (?)' USING 5, 6;
  11
 
 -- A SQL string composed in a SQL variable
-DECLARE sqlStr = 'SELECT SUM(c1) FROM VALUES(?), (?)';
+DECLARE sqlStr = 'SELECT SUM(col1) FROM VALUES(?), (?)';
 DECLARE arg1 = 5;
 DECLARE arg2 = 6;
 EXECUTE IMMEDIATE sqlStr USING arg1, arg2;
@@ -78,9 +78,8 @@ SELECT sum;
  11
 
 -- Using named parameter markers
-SET VAR sqlStr = 'SELECT SUM(c1) FROM VALUES(:first), (:second)';
-EXECUTE IMMEDIATE sqlStr INTO (sum)
-    USING 5 AS first, arg2 AS second;
+SET VAR sqlStr = 'SELECT SUM(col1) FROM VALUES(:first), (:second)';
+EXECUTE IMMEDIATE sqlStr INTO sum USING 5 AS first, arg2 AS second;
 SELECT sum;
  11
 ```
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org