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 08eaa477449 SQL parsing Enhancement: add more SQL test case for
create-materialized-view (#29072)
08eaa477449 is described below
commit 08eaa477449e9fe24d7db8e9fd828681b718462c
Author: +7 <[email protected]>
AuthorDate: Sat Nov 18 15:15:19 2023 +0800
SQL parsing Enhancement: add more SQL test case for
create-materialized-view (#29072)
* add more SQL test case for create-materialized-view
* format code
---
.../case/ddl/create-materialized-view.xml | 5 ++++
.../sql/supported/ddl/create-materialized-view.xml | 35 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git
a/test/it/parser/src/main/resources/case/ddl/create-materialized-view.xml
b/test/it/parser/src/main/resources/case/ddl/create-materialized-view.xml
index 81c7cfd2f9e..9a6325092e1 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-materialized-view.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-materialized-view.xml
@@ -26,4 +26,9 @@
<create-materialized-view
sql-case-id="create_materialized_view_with_refresh_fast_query_rewrite" />
<create-materialized-view
sql-case-id="create_materialized_view_with_refresh_fast_disable_query_rewrite"
/>
<create-materialized-view
sql-case-id="create_materialized_view_with_tablespace_parallel_build_immediate"
/>
+ <create-materialized-view
sql-case-id="create_materialized_view_with_pctfree_storage_parallel" />
+ <create-materialized-view
sql-case-id="create_materialized_view_with_refresh_fast_for_update" />
+ <create-materialized-view
sql-case-id="create_materialized_view_for_update" />
+ <create-materialized-view
sql-case-id="create_materialized_view_with_refresh_force" />
+ <create-materialized-view
sql-case-id="create_materialized_view_with_refresh_fast_for_update_as_with_recursive"
/>
</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/create-materialized-view.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/create-materialized-view.xml
index e45c17d1788..b2754b3a647 100644
---
a/test/it/parser/src/main/resources/sql/supported/ddl/create-materialized-view.xml
+++
b/test/it/parser/src/main/resources/sql/supported/ddl/create-materialized-view.xml
@@ -54,4 +54,39 @@
FROM times t, sales s, customers c
WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id
GROUP BY t.calendar_month_desc, c.cust_state_province;"
db-types="Oracle" />
+ <sql-case id="create_materialized_view_with_pctfree_storage_parallel"
value="CREATE MATERIALIZED VIEW cust_sales_mv
+ PCTFREE 0 TABLESPACE demo
+ STORAGE (INITIAL 8M)
+ PARALLEL
+ BUILD IMMEDIATE
+ REFRESH COMPLETE
+ ENABLE QUERY REWRITE AS
+ SELECT c.cust_last_name, SUM(amount_sold) AS sum_amount_sold
+ FROM customers c, sales s WHERE s.cust_id = c.cust_id
+ GROUP BY c.cust_last_name;" db-types="Oracle" />
+ <sql-case id="create_materialized_view_with_refresh_fast_for_update"
value="CREATE MATERIALIZED VIEW oe.categories_objmv OF oe.category_typ
+ REFRESH FAST FOR UPDATE
+ AS SELECT * FROM [email protected];" db-types="Oracle" />
+ <sql-case id="create_materialized_view_for_update" value="CREATE
MATERIALIZED VIEW foreign_customers FOR UPDATE
+ AS SELECT * FROM sh.customers@remote cu
+ WHERE EXISTS
+ (SELECT * FROM sh.countries@remote co
+ WHERE co.country_id = cu.country_id);" db-types="Oracle" />
+ <sql-case id="create_materialized_view_with_refresh_force" value="CREATE
MATERIALIZED VIEW detail_sales_mv
+ PARALLEL
+ BUILD IMMEDIATE
+ REFRESH FORCE AS
+ SELECT s.rowid 'sales_rid', c.cust_id, c.cust_last_name, s.amount_sold,
+ s.quantity_sold, s.time_id
+ FROM sales s, times t, customers c
+ WHERE s.cust_id = c.cust_id(+) AND s.time_id = t.time_id(+);"
db-types="Oracle" />
+ <sql-case
id="create_materialized_view_with_refresh_fast_for_update_as_with_recursive"
value="CREATE MATERIALIZED VIEW hr.employees REFRESH FAST FOR UPDATE AS
+ SELECT * FROM [email protected] e
+ WHERE EXISTS
+ (SELECT * FROM [email protected] d
+ WHERE e.department_id = d.department_id
+ AND EXISTS
+ (SELECT * FROM [email protected] l
+ WHERE l.country_id = 'UK'
+ AND d.location_id = l.location_id));" db-types="Oracle" />
</sql-cases>