You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2021/11/16 10:00:59 UTC

[shardingsphere] branch master updated: support pg/og union visit. (#13639)

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

duanzhengqiang 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 0e74117  support pg/og union visit. (#13639)
0e74117 is described below

commit 0e741178bf1228234f4f86030426fcb36f494b83
Author: tuichenchuxin <86...@users.noreply.github.com>
AuthorDate: Tue Nov 16 18:00:20 2021 +0800

    support pg/og union visit. (#13639)
---
 .../main/antlr4/imports/opengauss/DMLStatement.g4  |   1 +
 .../src/main/antlr4/imports/opengauss/Keyword.g4   |   4 +
 .../impl/OpenGaussStatementSQLVisitor.java         |  27 +++-
 .../impl/PostgreSQLStatementSQLVisitor.java        |  25 +++-
 .../sql/parser/sql/common/constant/UnionType.java  |   8 +-
 .../src/main/resources/case/dml/select-union.xml   | 163 +++++++++++++++++++++
 .../src/main/resources/case/dml/select.xml         |  22 ---
 .../resources/sql/supported/dml/select-union.xml   |  26 ++++
 .../main/resources/sql/supported/dml/select.xml    |   2 -
 9 files changed, 251 insertions(+), 27 deletions(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/DMLStatement.g4
index 716b0db..9e49e1d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/DMLStatement.g4
@@ -124,6 +124,7 @@ selectClauseN
     | selectClauseN UNION allOrDistinct? selectClauseN
     | selectClauseN INTERSECT allOrDistinct? selectClauseN
     | selectClauseN EXCEPT allOrDistinct? selectClauseN
+    | selectClauseN MINUS allOrDistinct? selectClauseN
     ;
 
 simpleSelect
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/Keyword.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/Keyword.g4
index 1d1e16a..61f5383 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/Keyword.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/imports/opengauss/Keyword.g4
@@ -592,6 +592,10 @@ EXCEPT
     : E X C E P T
     ;
 
+MINUS
+    : M I N U S
+    ;
+
 TIES
     : T I E S
     ;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
index 763b9ec..f98e48c 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
@@ -101,6 +101,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.Opt
 import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.AssignmentContext;
 import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.constant.UnionType;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
@@ -143,6 +144,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.li
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.union.UnionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasAvailable;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeLengthSegment;
@@ -801,7 +803,30 @@ public abstract class OpenGaussStatementSQLVisitor extends OpenGaussStatementBas
     
     @Override
     public ASTNode visitSelectClauseN(final SelectClauseNContext ctx) {
-        return null == ctx.simpleSelect() ? new OpenGaussSelectStatement() : visit(ctx.simpleSelect());
+        if (null != ctx.simpleSelect()) {
+            return visit(ctx.simpleSelect());
+        } else if (null != ctx.selectClauseN() && !ctx.selectClauseN().isEmpty()) {
+            OpenGaussSelectStatement result = (OpenGaussSelectStatement) visit(ctx.selectClauseN(0));
+            UnionSegment unionSegment = new UnionSegment(getUnionType(ctx), (OpenGaussSelectStatement) visit(ctx.selectClauseN(1)),
+                    ((TerminalNode) ctx.getChild(1)).getSymbol().getStartIndex(), ctx.getStop().getStopIndex());
+            result.getUnionSegments().add(unionSegment);
+            return result;
+        } else {
+            return visit(ctx.selectWithParens());
+        }
+    }
+    
+    private UnionType getUnionType(final SelectClauseNContext ctx) {
+        boolean isDistinct = null == ctx.allOrDistinct() || null != ctx.allOrDistinct().DISTINCT();
+        if (null != ctx.UNION()) {
+            return isDistinct ? UnionType.UNION_DISTINCT : UnionType.UNION_ALL;
+        } else if (null != ctx.INTERSECT()) {
+            return isDistinct ? UnionType.INTERSECT_DISTINCT : UnionType.INTERSECT_ALL;
+        } else if (null != ctx.MINUS()) {
+            return isDistinct ? UnionType.MINUS_DISTINCT : UnionType.MINUS_ALL;
+        } else {
+            return isDistinct ? UnionType.EXCEPT_DISTINCT : UnionType.EXCEPT_ALL;
+        }
     }
     
     @Override
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
index 16cc020..cec112d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
@@ -99,6 +99,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Wh
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.WindowClauseContext;
 import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
 import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.constant.UnionType;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
@@ -140,6 +141,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.li
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.union.UnionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasAvailable;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeLengthSegment;
@@ -770,7 +772,28 @@ public abstract class PostgreSQLStatementSQLVisitor extends PostgreSQLStatementB
     
     @Override
     public ASTNode visitSelectClauseN(final SelectClauseNContext ctx) {
-        return null == ctx.simpleSelect() ? new PostgreSQLSelectStatement() : visit(ctx.simpleSelect());
+        if (null != ctx.simpleSelect()) {
+            return visit(ctx.simpleSelect());
+        } else if (null != ctx.selectClauseN() && !ctx.selectClauseN().isEmpty()) {
+            PostgreSQLSelectStatement result = (PostgreSQLSelectStatement) visit(ctx.selectClauseN(0));
+            UnionSegment unionSegment = new UnionSegment(getUnionType(ctx), (PostgreSQLSelectStatement) visit(ctx.selectClauseN(1)),
+                    ((TerminalNode) ctx.getChild(1)).getSymbol().getStartIndex(), ctx.getStop().getStopIndex());
+            result.getUnionSegments().add(unionSegment);
+            return result;
+        } else {
+            return visit(ctx.selectWithParens());
+        }
+    }
+    
+    private UnionType getUnionType(final SelectClauseNContext ctx) {
+        boolean isDistinct = null == ctx.allOrDistinct() || null != ctx.allOrDistinct().DISTINCT();
+        if (null != ctx.UNION()) {
+            return isDistinct ? UnionType.UNION_DISTINCT : UnionType.UNION_ALL;
+        } else if (null != ctx.INTERSECT()) {
+            return isDistinct ? UnionType.INTERSECT_DISTINCT : UnionType.INTERSECT_ALL;
+        } else {
+            return isDistinct ? UnionType.EXCEPT_DISTINCT : UnionType.EXCEPT_ALL;
+        }
     }
     
     @Override
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/UnionType.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/UnionType.java
index 679ca6c..287ea6c 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/UnionType.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/UnionType.java
@@ -22,5 +22,11 @@ package org.apache.shardingsphere.sql.parser.sql.common.constant;
  */
 public enum UnionType {
     UNION_ALL,
-    UNION_DISTINCT;
+    UNION_DISTINCT,
+    INTERSECT_ALL,
+    INTERSECT_DISTINCT,
+    EXCEPT_ALL,
+    EXCEPT_DISTINCT,
+    MINUS_ALL,
+    MINUS_DISTINCT;
 }
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-union.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-union.xml
new file mode 100644
index 0000000..e3a641f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select-union.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <select sql-case-id="select_with_union">
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <from>
+            <simple-table name="table1" start-index="14" stop-index="19" />
+        </from>
+        <union union-type="UNION_DISTINCT" start-index="21" stop-index="46">
+            <select>
+                <projections start-index="34" stop-index="34">
+                    <shorthand-projection start-index="34" stop-index="34" />
+                </projections>
+                <from>
+                    <simple-table name="table2" start-index="41" stop-index="46" />
+                </from>
+            </select>
+        </union>
+    </select>
+
+    <select sql-case-id="select_union">
+        <projections start-index="7" stop-index="14">
+            <column-projection name="order_id" start-index="7" stop-index="14" />
+        </projections>
+        <from>
+            <simple-table name="t_order" start-index="21" stop-index="27" />
+        </from>
+        <union union-type="UNION_DISTINCT" start-index="29" stop-index="67">
+            <select>
+                <projections start-index="42" stop-index="49">
+                    <column-projection name="order_id" start-index="42" stop-index="49" />
+                </projections>
+                <from>
+                    <simple-table name="t_order_item" start-index="56" stop-index="67" />
+                </from>
+            </select>
+        </union>
+    </select>
+
+    <select sql-case-id="select_intersect">
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <from>
+            <simple-table name="table1" start-index="14" stop-index="19" />
+        </from>
+        <union union-type="INTERSECT_DISTINCT" start-index="21" stop-index="50">
+            <select>
+                <projections start-index="38" stop-index="38">
+                    <shorthand-projection start-index="38" stop-index="38" />
+                </projections>
+                <from>
+                    <simple-table name="table2" start-index="45" stop-index="50" />
+                </from>
+            </select>
+        </union>
+        <union union-type="INTERSECT_DISTINCT" start-index="52" stop-index="81">
+            <select>
+                <projections start-index="69" stop-index="69">
+                    <shorthand-projection start-index="69" stop-index="69" />
+                </projections>
+                <from>
+                    <simple-table name="table3" start-index="76" stop-index="81" />
+                </from>
+            </select>
+        </union>
+    </select>
+
+    <select sql-case-id="select_except">
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <from>
+            <simple-table name="table1" start-index="14" stop-index="19" />
+        </from>
+        <union union-type="EXCEPT_ALL" start-index="21" stop-index="51">
+            <select>
+                <projections start-index="39" stop-index="39">
+                    <shorthand-projection start-index="39" stop-index="39" />
+                </projections>
+                <from>
+                    <simple-table name="table2" start-index="46" stop-index="51" />
+                </from>
+            </select>
+        </union>
+        <union union-type="EXCEPT_ALL" start-index="53" stop-index="83">
+            <select>
+                <projections start-index="71" stop-index="71">
+                    <shorthand-projection start-index="71" stop-index="71" />
+                </projections>
+                <from>
+                    <simple-table name="table3" start-index="78" stop-index="83" />
+                </from>
+            </select>
+        </union>
+    </select>
+
+    <select sql-case-id="select_minus">
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <from>
+            <simple-table name="table1" start-index="14" stop-index="19" />
+        </from>
+        <union union-type="MINUS_DISTINCT" start-index="21" stop-index="46">
+            <select>
+                <projections start-index="34" stop-index="34">
+                    <shorthand-projection start-index="34" stop-index="34" />
+                </projections>
+                <from>
+                    <simple-table name="table2" start-index="41" stop-index="46" />
+                </from>
+            </select>
+        </union>
+    </select>
+
+    <select sql-case-id="select_sub_union">
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <from>
+            <simple-table name="table1" start-index="14" stop-index="19" />
+        </from>
+        <union union-type="UNION_DISTINCT" start-index="21" stop-index="75">
+            <select>
+                <projections start-index="35" stop-index="35">
+                    <shorthand-projection start-index="35" stop-index="35" />
+                </projections>
+                <from>
+                    <simple-table name="table2" start-index="42" stop-index="47" />
+                </from>
+                <union union-type="UNION_DISTINCT" start-index="49" stop-index="74">
+                    <select>
+                        <projections start-index="62" stop-index="62">
+                            <shorthand-projection start-index="62" stop-index="62" />
+                        </projections>
+                        <from>
+                            <simple-table name="table3" start-index="69" stop-index="74" />
+                        </from>
+                    </select>
+                </union>
+            </select>
+        </union>
+    </select>
+</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
index 1718886..6f54a88 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/dml/select.xml
@@ -94,9 +94,6 @@
         </where>
     </select>
 
-    <select sql-case-id="select_with_union">
-    </select>
-
     <select sql-case-id="select_with_function_name" >
         <projections start-index="7" stop-index="23">
             <expression-projection text="current_timestamp" start-index="7" stop-index="23">
@@ -3407,25 +3404,6 @@
         </order-by>
     </select>
 
-    <select sql-case-id="select_union">
-        <projections start-index="7" stop-index="14">
-            <column-projection name="order_id" start-index="7" stop-index="14" />
-        </projections>
-        <from>
-            <simple-table name="t_order" start-index="21" stop-index="27" />
-        </from>
-        <union union-type="UNION_DISTINCT" start-index="29" stop-index="67">
-            <select>
-                <projections start-index="42" stop-index="49">
-                    <column-projection name="order_id" start-index="42" stop-index="49" />
-                </projections>
-                <from>
-                    <simple-table name="t_order_item" start-index="56" stop-index="67" />
-                </from>
-            </select>
-        </union>
-    </select>
-
     <select sql-case-id="select_current_date_function_with_shorthand_regular_function">
         <projections start-index="7" stop-index="7">
             <shorthand-projection start-index="7" stop-index="7" />
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-union.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-union.xml
new file mode 100644
index 0000000..6951911
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select-union.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-cases>
+    <sql-case id="select_with_union" value="SELECT * from table1 union select * from table2" db-types="MySQL,PostgreSQL,openGauss"/>
+    <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL,PostgreSQL,openGauss" />
+    <sql-case id="select_intersect" value="SELECT * FROM table1 INTERSECT SELECT * FROM table2 INTERSECT SELECT * FROM table3" db-types="PostgreSQL,openGauss" />
+    <sql-case id="select_except" value="SELECT * FROM table1 EXCEPT ALL SELECT * FROM table2 EXCEPT ALL SELECT * FROM table3" db-types="PostgreSQL,openGauss" />
+    <sql-case id="select_minus" value="SELECT * FROM table1 MINUS SELECT * FROM table2" db-types="openGauss" />
+    <sql-case id="select_sub_union" value="SELECT * FROM table1 UNION (SELECT * FROM table2 UNION SELECT * FROM table3)" db-types="MySQL,PostgreSQL,openGauss" />
+</sql-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
index dc1e22c..5b7c9f2 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
@@ -22,7 +22,6 @@
     <sql-case id="select_with_binary_operation_of_aggregation_expr" value="SELECT (count(*)+1) as a" db-types="MySQL" />
     <sql-case id="select_with_schema_func" value="SELECT schema(), database()" db-types="MySQL" />
     <sql-case id="select_sqlmode_ansi_quotes" value='select "id" from "t_order" where "t_order"."id"=10' db-types="MySQL" />
-    <sql-case id="select_with_union" value="SELECT * from table1 union select * from table2" db-types="PostgreSQL,openGauss"/>
     <sql-case id="select_with_function_name" value="SELECT current_timestamp" db-types="MySQL"/>
     <sql-case id="select_with_same_table_name_and_alias" value="SELECT t_order.* FROM t_order t_order WHERE user_id = ? AND order_id = ?" />
     <sql-case id="select_with_same_table_name_and_alias_column_with_owner" value="SELECT t_order.order_id,t_order.user_id,status FROM t_order t_order WHERE t_order.user_id = ? AND order_id = ?" db-types="MySQL,H2"/>
@@ -94,7 +93,6 @@
     <sql-case id="select_with_lateral_clause" value="SELECT * FROM employees e, LATERAL(SELECT * FROM departments d WHERE e.department_id = d.department_id)" db-types="Oracle" />
     <sql-case id="select_with_containers" value="SELECT * FROM CONTAINERS(employees)" db-types="Oracle" />
     <sql-case id="select_with_hierarchical_connect_by" value="SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name" db-types="Oracle" />
-    <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL" />
     <sql-case id="select_current_date_function_with_shorthand_regular_function" value="SELECT * FROM t_order WHERE date = CURRENT_DATE" db-types="MySQL"/>
     <sql-case id="select_current_date_function_with_complete_regular_function" value="SELECT * FROM t_order WHERE date = CURRENT_DATE()" db-types="MySQL"/>
     <sql-case id="select_current_time_function_with_shorthand_regular_function" value="SELECT * FROM t_order WHERE time = CURRENT_TIME" db-types="MySQL"/>