Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL parsing Enhancement: add more SQL test case for create-materialized-view #29072

Merged
merged 2 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>