You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/01/10 03:00:34 UTC

[shardingsphere] branch master updated: Support openGauss EXPLAIN PERFORMANCE (#23455)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4905ac253e0 Support openGauss EXPLAIN PERFORMANCE (#23455)
4905ac253e0 is described below

commit 4905ac253e014a9740ab03096caf42186fb30f33
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Tue Jan 10 11:00:26 2023 +0800

    Support openGauss EXPLAIN PERFORMANCE (#23455)
    
    * Support openGauss EXPLAIN PERFORMANCE
    
    * Add parser case for openGauss EXPLAIN PERFORMANCE
---
 .../opengauss/src/main/antlr4/imports/opengauss/DALStatement.g4   | 1 +
 .../src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4         | 4 ++++
 test/it/parser/src/main/resources/case/dal/explain.xml            | 8 ++++++++
 test/it/parser/src/main/resources/sql/supported/dal/explain.xml   | 1 +
 4 files changed, 14 insertions(+)

diff --git a/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/DALStatement.g4 b/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/DALStatement.g4
index a9c9bf8ba00..c7e2d9c0147 100644
--- a/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/DALStatement.g4
+++ b/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/DALStatement.g4
@@ -58,6 +58,7 @@ explain
     : EXPLAIN
     (analyzeKeyword VERBOSE?
     | VERBOSE
+    | PERFORMANCE
     | LP_ explainOptionList RP_)?
     explainableStmt
     ;
diff --git a/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4 b/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
index 3bc8356e671..86691599351 100644
--- a/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
+++ b/sql-parser/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
@@ -1380,6 +1380,10 @@ AUTHORIZATION
 VERBOSE
     : V E R B O S E
     ;
+    
+PERFORMANCE
+    : P E R F O R M A N C E
+    ;
 
 PARAM
     : P A R A M
diff --git a/test/it/parser/src/main/resources/case/dal/explain.xml b/test/it/parser/src/main/resources/case/dal/explain.xml
index c637e9d02a3..906adebe7a6 100644
--- a/test/it/parser/src/main/resources/case/dal/explain.xml
+++ b/test/it/parser/src/main/resources/case/dal/explain.xml
@@ -284,4 +284,12 @@
     
     <describe sql-case-id="explain_create_materialized_view_with_data" />
     <describe sql-case-id="explain_create_materialized_view_with_no_data" />
+    
+    <describe sql-case-id="explain_performance">
+        <select>
+            <projections start-index="27" stop-index="27">
+                <expression-projection text="1" start-index="27" stop-index="27" />
+            </projections>
+        </select>
+    </describe>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/explain.xml b/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
index 96e880092fe..e76683442f6 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
@@ -38,4 +38,5 @@
     <sql-case id="describe_table_with_wild" value="DESC tableName `u%`" db-types="MySQL" />
     <sql-case id="explain_create_materialized_view_with_data" value="EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) CREATE MATERIALIZED VIEW matview_schema.mv_withdata2 (a) AS SELECT generate_series(1, 10) WITH DATA;" db-types="PostgreSQL" />
     <sql-case id="explain_create_materialized_view_with_no_data" value="EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF) CREATE MATERIALIZED VIEW matview_schema.mv_nodata2 (a) AS SELECT generate_series(1, 10) WITH NO DATA;" db-types="PostgreSQL" />
+    <sql-case id="explain_performance" value="EXPLAIN PERFORMANCE SELECT 1" db-types="openGauss" />
 </sql-cases>