This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 6cb1c5fddc2 Add more SQL parser test cases on ClickHouse (#37611)
6cb1c5fddc2 is described below
commit 6cb1c5fddc2cdd2ad63fe8d387ba57e61c62cae6
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jan 1 22:12:23 2026 +0800
Add more SQL parser test cases on ClickHouse (#37611)
---
.../src/main/resources/case/dml/clickhouse.xml | 34 ++++++++++++++++++++++
.../resources/sql/supported/dml/clickhouse.xml | 2 ++
2 files changed, 36 insertions(+)
diff --git a/test/it/parser/src/main/resources/case/dml/clickhouse.xml
b/test/it/parser/src/main/resources/case/dml/clickhouse.xml
index 15696d1e27d..3648ba8a606 100644
--- a/test/it/parser/src/main/resources/case/dml/clickhouse.xml
+++ b/test/it/parser/src/main/resources/case/dml/clickhouse.xml
@@ -906,6 +906,40 @@
</from>
</select>
+ <select sql-case-id="clickhouse_select_compare_any_subquery_paren">
+ <projections start-index="7" stop-index="7">
+ <shorthand-projection start-index="7" stop-index="7" />
+ </projections>
+ <from>
+ <simple-table name="t_order" start-index="14" stop-index="20" />
+ </from>
+ <where start-index="22" stop-index="39">
+ <expr>
+ <binary-operation-expression start-index="29" stop-index="38">
+ <left>
+ <column name="status" start-index="29" stop-index="34"
/>
+ </left>
+ <operator>=</operator>
+ <right>
+ <literal-expression value="1" start-index="38"
stop-index="38" />
+ </right>
+ </binary-operation-expression>
+ </expr>
+ </where>
+ </select>
+
+ <insert sql-case-id="clickhouse_insert_default_value">
+ <table name="t_order" start-index="12" stop-index="18" />
+ <columns start-index="19" stop-index="19" />
+ <values>
+ <value>
+ <assignment-value>
+ <column name="DEFAULT" start-index="28" stop-index="34" />
+ </assignment-value>
+ </value>
+ </values>
+ </insert>
+
<select sql-case-id="clickhouse_select_addition_no_alias">
<projections start-index="7" stop-index="18">
<expression-projection text="order_id + 1" start-index="7"
stop-index="18">
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
b/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
index 98541b3b3df..13504b7cfc4 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
@@ -44,6 +44,8 @@
<sql-case id="clickhouse_select_or_boolean" value="SELECT * FROM t_order
WHERE status IS TRUE OR amount > 100" db-types="ClickHouse" />
<sql-case id="clickhouse_select_is_false" value="SELECT * FROM t_order
WHERE is_deleted IS FALSE" db-types="ClickHouse" />
<sql-case id="clickhouse_select_parenthesized_right_cross_join"
value="SELECT * FROM (t_order o RIGHT JOIN t_order_item i ON o.order_id =
i.order_id) CROSS JOIN t_user u" db-types="ClickHouse" />
+ <sql-case id="clickhouse_select_compare_any_subquery_paren" value="SELECT
* FROM t_order WHERE (status = 1)" db-types="ClickHouse" />
+ <sql-case id="clickhouse_insert_default_value" value="INSERT INTO t_order
VALUES (DEFAULT)" db-types="ClickHouse" />
<sql-case id="clickhouse_select_addition_no_alias" value="SELECT order_id
+ 1 FROM t_order" db-types="ClickHouse" />
<sql-case id="clickhouse_select_hex_bit_literals" value="SELECT * FROM
t_order WHERE hex_col = X'1A' AND bit_col = B'101'" db-types="ClickHouse" />
<sql-case id="clickhouse_update_set_default" value="UPDATE t_order SET
status = DEFAULT WHERE order_id = 1" db-types="ClickHouse" />