should be it
This commit is contained in:
8
external/duckdb/test/sql/peg_parser/alter.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/alter.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/alter.test
|
||||
# description: Test analyze and vacuum statements in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE tbl SET SORTED BY (i DESC NULLS FIRST)$TEST_PEG_PARSER$);
|
||||
20
external/duckdb/test/sql/peg_parser/analyze_vacuum.test
vendored
Normal file
20
external/duckdb/test/sql/peg_parser/analyze_vacuum.test
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# name: test/sql/peg_parser/analyze_vacuum.test
|
||||
# description: Test analyze and vacuum statements in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ANALYZE;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ANALYZE test(x);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$VACUUM test(i);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$VACUUM;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$VACUUM db1.integers;$TEST_PEG_PARSER$);
|
||||
20
external/duckdb/test/sql/peg_parser/array_subquery.test
vendored
Normal file
20
external/duckdb/test/sql/peg_parser/array_subquery.test
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# name: test/sql/peg_parser/array_subquery.test
|
||||
# description: Test array syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT ARRAY[42]$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT ARRAY(SELECT 42)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT ARRAY((SELECT 42))$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT i, ARRAY( SELECT * FROM integers WHERE i>i1.i ORDER BY i ) top FROM integers i1 ORDER BY i$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select array(select distinct i from t order by i desc) as a, array(select distinct i from t order by i desc) as b, array(select distinct i from t order by i desc) as c;$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/attach_or_replace.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/attach_or_replace.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/attach_or_replace.test
|
||||
# description: Test attach or replace in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ATTACH OR REPLACE '__TEST_DIR__/attach_or_replace.db' AS db1;$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/collate.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/collate.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/collate.test
|
||||
# description: Test create table syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select left(b collate de, 6) from tbl order by all;$TEST_PEG_PARSER$);
|
||||
17
external/duckdb/test/sql/peg_parser/colon_alias.test
vendored
Normal file
17
external/duckdb/test/sql/peg_parser/colon_alias.test
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# name: test/sql/peg_parser/colon_alias.test
|
||||
# description: Test colon alias in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * FROM b : a$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * FROM foo: tablefunction()$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$with cte1 as MATERIALIZED (Select i as j from a) select x from cte1 t1(x);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$from my_wonderful_values : (values(42))$TEST_PEG_PARSER$);
|
||||
12
external/duckdb/test/sql/peg_parser/copy_expression.test
vendored
Normal file
12
external/duckdb/test/sql/peg_parser/copy_expression.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# name: test/sql/peg_parser/copy_expression.test
|
||||
# description: Test copy expression syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$COPY (SELECT * FROM foo) TO ('foo') WITH (HEADER)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$COPY (SELECT * FROM range(5) t(i)) TO (getvariable('copy_target')) WITH (HEADER)$TEST_PEG_PARSER$);
|
||||
|
||||
15
external/duckdb/test/sql/peg_parser/create_macro.test
vendored
Normal file
15
external/duckdb/test/sql/peg_parser/create_macro.test
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# name: test/sql/peg_parser/create_macro.test
|
||||
# description: Test create table syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create macro my_range(x) as table from range(x);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create macro m(s varchar) as s || 'c'$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create or replace macro m(s varchar := 'cc') as s || 'c'$TEST_PEG_PARSER$);
|
||||
|
||||
26
external/duckdb/test/sql/peg_parser/create_table.test
vendored
Normal file
26
external/duckdb/test/sql/peg_parser/create_table.test
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# name: test/sql/peg_parser/create_table.test
|
||||
# description: Test create table syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE test (bar GENERATED ALWAYS AS (1));$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE database.schema.table(col INTEGER);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT flags.desc;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO database.schema.table VALUES ({'field': 42});$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE tbl4(foo, bar) AS SELECT 1;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TEMPORARY TABLE integers(i INTEGER) ON COMMIT PRESERVE ROWS;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE tbl8 AS SELECT 42 WITH NO DATA$TEST_PEG_PARSER$);
|
||||
9
external/duckdb/test/sql/peg_parser/create_type.test
vendored
Normal file
9
external/duckdb/test/sql/peg_parser/create_type.test
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# name: test/sql/peg_parser/create_type.test
|
||||
# description: Test create table syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE t4 AS UNION ( v0 SETOF t4 );$TEST_PEG_PARSER$);
|
||||
|
||||
8
external/duckdb/test/sql/peg_parser/delete_from.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/delete_from.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/delete_from.test
|
||||
# description: Test delete statement in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$DELETE FROM integers i1 WHERE i>(SELECT MAX(i) FROM integers WHERE i1.i<>i)$TEST_PEG_PARSER$);
|
||||
34
external/duckdb/test/sql/peg_parser/dollar_quoted.test
vendored
Normal file
34
external/duckdb/test/sql/peg_parser/dollar_quoted.test
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# name: test/sql/peg_parser/dollar_quoted.test
|
||||
# description: Test dollar quoted strings in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$set variable time_travel_snapshot_id = $$foo$$$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select $🦆$du ck$🦆$ = $🦆$du ck$🦆$;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$prepare p4 as select $name, $other_name$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$prepare q123 as select $param, $other_name, $param;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select $tag$ $duck$ $tag$ = $tag$ $duck$ $tag$;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select $tag$ $tag$ = $tag$ $tag$;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT $marker$[hello, world]$marker$::VARCHAR[];$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT $$[hello, world]$$::VARCHAR[];$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT $${quote_at_start: "\"test\"", age: 30}$$::STRUCT(age INT);$TEST_PEG_PARSER$);
|
||||
|
||||
|
||||
8
external/duckdb/test/sql/peg_parser/dotted_functions.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/dotted_functions.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/dotted_functions.test
|
||||
# description: Test dollar quoted strings in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT v.trim()$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/empty_map.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/empty_map.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/empty_map.test
|
||||
# description: Test empty map syntax peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT MAP {};$TEST_PEG_PARSER$);
|
||||
9
external/duckdb/test/sql/peg_parser/ignore_nulls.test
vendored
Normal file
9
external/duckdb/test/sql/peg_parser/ignore_nulls.test
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# name: test/sql/peg_parser/ignore_nulls.test
|
||||
# description: Test window function syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$explain select first_value(i IGNORE NULLS) over () from integers$TEST_PEG_PARSER$);
|
||||
|
||||
21
external/duckdb/test/sql/peg_parser/index.test
vendored
Normal file
21
external/duckdb/test/sql/peg_parser/index.test
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# name: test/sql/peg_parser/index.test
|
||||
# description: Test index syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create unique index part_comp_key_index on insertconflicttest(key, fruit) where 1;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE INDEX my_ip_idx ON t1 USING HNSW (vec) WITH (metric = 'ip');$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE INDEX idx ON embeddings USING HNSW (vec) WITH (ef_construction = 100, ef_search = 100, M = 3, M0 = 3);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$DROP INDEX simple.new_schema.i_index$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$DROP INDEX s.i_index;$TEST_PEG_PARSER$);
|
||||
|
||||
16
external/duckdb/test/sql/peg_parser/insert.test
vendored
Normal file
16
external/duckdb/test/sql/peg_parser/insert.test
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# name: test/sql/peg_parser/insert.test
|
||||
# description: Test analyze and vacuum statements in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT TRUE OFFSET 1 ROWS;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO v0 BY POSITION ( SELECT TRUE ) OFFSET 1 ROWS RETURNING v0;$TEST_PEG_PARSER$);
|
||||
|
||||
statement error
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO table2 WITH cte AS (INSERT INTO table1 SELECT 1) SELECT id FROM cte;$TEST_PEG_PARSER$);
|
||||
----
|
||||
<REGEX>:.*Binder Error.*
|
||||
8
external/duckdb/test/sql/peg_parser/invisible_space.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/invisible_space.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/invisible_space.test
|
||||
# description: Test invisible space in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ $TEST_PEG_PARSER$);
|
||||
23
external/duckdb/test/sql/peg_parser/lambda_functions.test
vendored
Normal file
23
external/duckdb/test/sql/peg_parser/lambda_functions.test
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# name: test/sql/peg_parser/lambda_functions.test
|
||||
# description: Test lambda syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select list_apply(maps, lambda x: map_keys(x)) from tbl;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$PREPARE v1 AS SELECT list_transform(?, lambda x: x + 1)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT COLUMNS(lambda x: x LIKE 'col%') FROM integers$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create table tbl as select i // 5_000 as num, num::VARCHAR || list_reduce([uuid()::varchar for x in range(10)], lambda x, y: concat(x, y)) str from range(20_000) t(i) order by num$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT a.filter(lambda x: x > 0) FROM arrays$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT list_transform(array_value(3,2,1), lambda x: x + 1) = list_transform([3,2,1], lambda x: x + 1);$TEST_PEG_PARSER$);
|
||||
11
external/duckdb/test/sql/peg_parser/list_slices.test
vendored
Normal file
11
external/duckdb/test/sql/peg_parser/list_slices.test
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# name: test/sql/peg_parser/list_slices.test
|
||||
# description: Test list slices in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT ([1,2,3])[1:-1:1];$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT ([1,2,3,4,5])[1:-:2];$TEST_PEG_PARSER$);
|
||||
24
external/duckdb/test/sql/peg_parser/load_extension.test
vendored
Normal file
24
external/duckdb/test/sql/peg_parser/load_extension.test
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# name: test/sql/peg_parser/load_extension.test
|
||||
# description: Test loading extensions in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSTALL tpch;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FORCE INSTALL tpch;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FORCE INSTALL tpch;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FORCE INSTALL tpch FROM '${LOCAL_EXTENSION_REPO_UPDATED}'$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$LOAD tpch;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$LOAD '${SPATIAL_EXTENSION}'$TEST_PEG_PARSER$);
|
||||
|
||||
12
external/duckdb/test/sql/peg_parser/map.test
vendored
Normal file
12
external/duckdb/test/sql/peg_parser/map.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# name: test/sql/peg_parser/map.test
|
||||
# description: Test create table syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE MAP(i BIGINT);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT map([1,2])$TEST_PEG_PARSER$);
|
||||
|
||||
27
external/duckdb/test/sql/peg_parser/merge_into.test
vendored
Normal file
27
external/duckdb/test/sql/peg_parser/merge_into.test
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# name: test/sql/peg_parser/merge_into.test
|
||||
# description: Test merge into syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$WITH initial_stocks(item_id, balance) AS (VALUES (10, 2200), (20, 1900)) MERGE INTO Stock USING initial_stocks ON FALSE WHEN MATCHED THEN DO NOTHING WHEN NOT MATCHED THEN INSERT VALUES (initial_stocks.item_id, initial_stocks.balance) RETURNING merge_action, *$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$MERGE INTO Stock USING (VALUES (30)) new_accounts(item_id) USING (item_id) WHEN NOT MATCHED THEN INSERT DEFAULT VALUES$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$WITH initial_stocks(item_id, balance) AS (VALUES (10, 2200), (20, 1900)) MERGE INTO Stock USING initial_stocks ON FALSE WHEN MATCHED THEN DO NOTHING WHEN NOT MATCHED THEN INSERT VALUES (initial_stocks.item_id, initial_stocks.balance)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$MERGE INTO Stock USING (VALUES (5, 10)) new_accounts(item_id) USING (item_id)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$MERGE INTO Stock USING (VALUES (5, 10)) new_accounts(item_id) USING (item_id) WHEN MATCHED THEN UPDATE$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$MERGE INTO Accounts USING ( VALUES (1, 'user2', [1, 2, 3]) ) new_account(id) USING (id) WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$MERGE INTO Stock USING (VALUES (10)) new_accounts(item_id) USING (item_id) WHEN NOT MATCHED THEN INSERT VALUES (new_accounts.item_id, DEFAULT)$TEST_PEG_PARSER$);
|
||||
|
||||
8
external/duckdb/test/sql/peg_parser/nested_join.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/nested_join.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/nested_join.test
|
||||
# description: Test nested joins in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$from tenk1 join tenk1 join int8_tbl on 1 = 1 on 1 = 1;$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/on_conflict.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/on_conflict.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/on_conflict.test
|
||||
# description: Test insert into with conflict syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO tbl_comp VALUES (2, 'hello', 1, 'world') ON CONFLICT (c, b) DO UPDATE SET a = excluded.a, d = excluded.d;$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/pivot_statement.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/pivot_statement.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/pivot_statement.test
|
||||
# description: Test pivot statement in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * FROM oncall UNPIVOT ((name) FOR precedence IN ((name1), (name2)));$TEST_PEG_PARSER$);
|
||||
8
external/duckdb/test/sql/peg_parser/prepare_statement.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/prepare_statement.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/prepare_statement.test
|
||||
# description: Test prepare statement in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$prepare p4 as select $name, $other_name$TEST_PEG_PARSER$);
|
||||
23
external/duckdb/test/sql/peg_parser/recursive.test
vendored
Normal file
23
external/duckdb/test/sql/peg_parser/recursive.test
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# name: test/sql/peg_parser/recursive.test
|
||||
# description: Test recursive cte in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE RECURSIVE VIEW nums (n) AS VALUES (1) UNION ALL SELECT n+1;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$WITH RECURSIVE tbl(a) USING KEY (a) AS (SELECT 1 UNION SELECT a.a+1 FROM tbl AS a) SELECT * FROM tbl;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM (WITH foo2 AS ((WITH a AS (SELECT 1) (FROM a))) TABLE foo2);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM (WITH foo AS (SELECT 1) (FROM foo)) foo;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$(FROM foo);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM (WITH foo AS (SELECT 1) FROM foo) foo;$TEST_PEG_PARSER$);
|
||||
20
external/duckdb/test/sql/peg_parser/sample.test
vendored
Normal file
20
external/duckdb/test/sql/peg_parser/sample.test
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# name: test/sql/peg_parser/sample.test
|
||||
# description: Test sample clause in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select count(*) from range(200000) using sample reservoir(90 PERCENT);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select count(*) from range(200000) tablesample reservoir(90 PERCENT);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT COUNT(*) FROM test USING SAMPLE 3 (reservoir);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select count(*) from integers tablesample reservoir(10);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * from t1 using sample reservoir(6000) repeatable (1) order by a;$TEST_PEG_PARSER$);
|
||||
18
external/duckdb/test/sql/peg_parser/select_star.test
vendored
Normal file
18
external/duckdb/test/sql/peg_parser/select_star.test
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# name: test/sql/peg_parser/select_star.test
|
||||
# description: Test select star expression in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT integers.* EXCLUDE ('i')$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * EXCLUDE (db1.s1.t.c) FROM db1.s1.t, db2.s1.t$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT struct.*$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select t.* from ((select 1) cross join (select 1)) as t$TEST_PEG_PARSER$);
|
||||
|
||||
9
external/duckdb/test/sql/peg_parser/show_table.test
vendored
Normal file
9
external/duckdb/test/sql/peg_parser/show_table.test
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# name: test/sql/peg_parser/show_table.test
|
||||
# description: Test create macro syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SHOW TABLES FROM db.main$TEST_PEG_PARSER$);
|
||||
|
||||
33
external/duckdb/test/sql/peg_parser/struct_identifier.test
vendored
Normal file
33
external/duckdb/test/sql/peg_parser/struct_identifier.test
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# name: test/sql/peg_parser/struct_identifier.test
|
||||
# description: Test struct identifier in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test ADD COLUMN s.i INTEGER$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test RENAME s.i TO v1$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test RENAME s.s2.v1 TO i$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test DROP COLUMN s.i$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test DROP s.s2.v1$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test ADD COLUMN s.k INTEGER$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test RENAME COLUMN s.value.j TO abc$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test RENAME COLUMN s.element.j TO k$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ALTER TABLE test DROP COLUMN s.element.j$TEST_PEG_PARSER$);
|
||||
|
||||
9
external/duckdb/test/sql/peg_parser/support_optional_not_null_constraint.test
vendored
Normal file
9
external/duckdb/test/sql/peg_parser/support_optional_not_null_constraint.test
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# name: test/sql/peg_parser/support_optional_not_null_constraint.test
|
||||
# description: Test optional not null constraint in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE tag_8764 ( key VARCHAR(65535) NOT NULL, name VARCHAR(65535) NULL, value VARCHAR(65535) NOT NULL, PRIMARY KEY (key, name) );$TEST_PEG_PARSER$);
|
||||
|
||||
8
external/duckdb/test/sql/peg_parser/support_try.test
vendored
Normal file
8
external/duckdb/test/sql/peg_parser/support_try.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# name: test/sql/peg_parser/support_try.test
|
||||
# description: Test try cast syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select TRY(~CAST('abc' as INTEGER))$TEST_PEG_PARSER$);
|
||||
201
external/duckdb/test/sql/peg_parser/support_unreserved_keywords.test
vendored
Normal file
201
external/duckdb/test/sql/peg_parser/support_unreserved_keywords.test
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
# name: test/sql/peg_parser/support_unreserved_keywords.test
|
||||
# description: Test supporting different categories of keywords in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE OR REPLACE TABLE 'everflow_daily' AS SELECT *$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE tmp.t1(id int);$TEST_PEG_PARSER$);
|
||||
|
||||
require tpch
|
||||
|
||||
statement ok
|
||||
CREATE SCHEMA abcdefgh;
|
||||
|
||||
query II
|
||||
FROM sql_auto_complete('CREATE TABLE abcd') LIMIT 1;
|
||||
----
|
||||
abcdefgh. 13
|
||||
|
||||
|
||||
statement ok
|
||||
CALL dbgen(sf=0);
|
||||
|
||||
query II
|
||||
FROM sql_auto_complete('INSERT INTO lin') LIMIT 1;
|
||||
----
|
||||
lineitem 12
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE database.schema.table(foo integer);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE MACRO foo(a,b) as TABLE select *;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO database.schema.table VALUES ({'field': 42});$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM database.schema.table;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select * from 'data/csv/nullbyte.csv';$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE foo(try_cast INTEGER);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT "hello world".i FROM foo AS 'hello world'$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM information_schema.schema$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM information_schema.columns$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$DROP TABLE IF EXISTS map;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE map(v INTEGER);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$RESET VARIABLE foo$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select left(b collate de, 6)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT v.trim('><')$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE bits (b bit);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE issue14384(i INTERVAL);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT cast(1 as INT)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT 1::SMALLINT$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$copy integers to '__TEST_DIR__/integers.json.gz' (FORMAT JSON, COMPRESSION GZIP)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE OR REPLACE TABLE t( x VARCHAR USING COMPRESSION Dictionary );$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select distinct on (types) types from (select vector_type(a) from test limit 8192) tbl(types)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create table data(id integer, value integer);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$create table t2 (id int, v_map struct(foo integer[]));$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$ATTACH '__TEST_DIR__/encrypted.duckdb' AS encrypted (ENCRYPTION_KEY 'asdf');$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT COUNT(*) FROM glob('__TEST_DIR__/attach_no_wal.db.wal');$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$prepare p4 as select $name, $other_name$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE testjson AS SELECT JSON '{ "key" : "value" }';$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$COPY FROM DATABASE unencrypted TO encrypted;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$INSERT INTO hero (name, secret_name, age) VALUES (1) ON CONFLICT (name) DO UPDATE SET secret_name = EXCLUDED.secret_name, age = EXCLUDED.age;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT list_reduce(s, lambda curr, next: struct_pack(a:=curr.a + (next.b - curr.b), b:=next.b)) FROM df$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select features[1].name;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT last(value ORDER BY foo IGNORE NULLS)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select UNPACK(a)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select sum(salary) over (order by enroll_date range between '1 year' preceding and '1 year' following)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TEMPORARY MACRO my_seq(start, finish, stride:=3) as TABLE SELECT *;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE history(id TEXT, type TEXT, PRIMARY KEY(id, type));$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$UNPIVOT PivotedCities ON 2000, 2010, 2020 INTO NAME YEAR VALUE Population;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$WITH data AS ( SELECT 1 as a, 2 as b, 3 as c ) SELECT d FROM data d$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$insert into data (id, value) select 1$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT UNNEST({'a': 42, 'b': {'c': 88, 'd': 99}}, recursive := true)$TEST_PEG_PARSER$);
|
||||
|
||||
# Reserved keyword as explicit alias
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2 as end;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE big_tbl AS SELECT i, concat('thisisalongstring', i) as str FROM range(10000000) t(i);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select distinct on (a) b from (select s a, md5(s::text)) limit 10;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select distinct on (a) b from (select s a, md5(s::double)) limit 10;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT histogram_exact((date '2000-01-01' + interval (n) days))$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT MAP{ 0 : 0 } FROM lineitem$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT l_returnflag, map { '0': case when sum(1) filter(l_orderkey <= 0) is null then 0 end, '1000000': sum(1) filter(l_orderkey > 0 and l_orderkey <= 1000000), '2000000': sum(1) filter(l_orderkey > 1000000 and l_orderkey <= 2000000), '3000000': sum(1) filter(l_orderkey > 2000000 and l_orderkey <= 3000000), '4000000': sum(1) filter(l_orderkey > 3000000 and l_orderkey <= 4000000), '5000000': sum(1) filter(l_orderkey > 4000000 and l_orderkey <= 5000000), '6000000': sum(1) filter(l_orderkey > 5000000 and l_orderkey <= 6000000) } FROM lineitem GROUP BY l_returnflag ORDER BY l_returnflag$TEST_PEG_PARSER$);
|
||||
|
||||
# Non keyword as explicit alias
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2 as foo;$TEST_PEG_PARSER$);
|
||||
|
||||
# Non keyword implicit alias
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2 foo;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT foo: c2;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2 'foo';$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2, c1 FROM (SELECT a)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT number1, number2 SIMILAR TO '0' as a;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT number1, number2 SIMILAR TO '0' as 'a';$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT * SIMILAR TO '0' as 'a';$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT c2, c1 FROM ( SELECT * SIMILAR TO 'number(\d+)' AS 'c\1' FROM (SELECT 1 as number1, 2 as number2, 3 as end) );$TEST_PEG_PARSER$);
|
||||
17
external/duckdb/test/sql/peg_parser/transformer/peg_transformer.test
vendored
Normal file
17
external/duckdb/test/sql/peg_parser/transformer/peg_transformer.test
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# name: test/sql/peg_parser/transformer/peg_transformer.test
|
||||
# description: Test analyze and vacuum statements in peg parser
|
||||
# group: [transformer]
|
||||
|
||||
require autocomplete
|
||||
|
||||
require skip_reload
|
||||
|
||||
require no_extension_autoloading "FIXME: to be reviewed whether this can be lifted"
|
||||
|
||||
statement ok
|
||||
set allow_parser_override_extension=strict;
|
||||
|
||||
statement error
|
||||
select 1;
|
||||
----
|
||||
Not implemented Error: Parser override has not yet implemented this transformer rule. (Original error: No transformer function found for rule 'SelectStatement')
|
||||
27
external/duckdb/test/sql/peg_parser/transformer/set_statement.test
vendored
Normal file
27
external/duckdb/test/sql/peg_parser/transformer/set_statement.test
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# name: test/sql/peg_parser/transformer/set_statement.test
|
||||
# description: Test lambda syntax in peg parser
|
||||
# group: [transformer]
|
||||
|
||||
require autocomplete
|
||||
|
||||
require icu
|
||||
|
||||
statement ok
|
||||
set allow_parser_override_extension=strict;
|
||||
|
||||
statement ok
|
||||
SET threads=1;
|
||||
|
||||
statement ok
|
||||
set VARIABLE dataset_size = 122880;
|
||||
|
||||
statement error
|
||||
SET GLOBAL enable_progress_bar=true;
|
||||
----
|
||||
Catalog Error: option "enable_progress_bar" cannot be set globally
|
||||
|
||||
statement ok
|
||||
RESET threads;
|
||||
|
||||
statement ok
|
||||
SET TimeZone='UTC';
|
||||
24
external/duckdb/test/sql/peg_parser/transformer/use_statement.test
vendored
Normal file
24
external/duckdb/test/sql/peg_parser/transformer/use_statement.test
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# name: test/sql/peg_parser/transformer/use_statement.test
|
||||
# description: Test use statement with new transformer
|
||||
# group: [transformer]
|
||||
|
||||
require autocomplete
|
||||
|
||||
require skip_reload
|
||||
|
||||
require no_extension_autoloading "FIXME: to be reviewed whether this can be lifted"
|
||||
|
||||
statement ok
|
||||
ATTACH ':memory:' as "my""db";
|
||||
|
||||
statement ok
|
||||
CREATE TABLE "my""db".tbl(i int);
|
||||
|
||||
statement ok
|
||||
INSERT INTO "my""db".tbl VALUES (42)
|
||||
|
||||
statement ok
|
||||
set allow_parser_override_extension=strict;
|
||||
|
||||
statement ok
|
||||
USE "my""db";
|
||||
49
external/duckdb/test/sql/peg_parser/type.test
vendored
Normal file
49
external/duckdb/test/sql/peg_parser/type.test
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# name: test/sql/peg_parser/type.test
|
||||
# description: Test create custom types in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE type_int AS ENUM (SELECT 1);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE number_enum AS ENUM (SELECT x FROM number_str);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE type_int AS ENUM ('a','b');$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE type_int AS BIGINT;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE decs(i DEC())$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE decimals(i DECIMAL(), j DECIMAL)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE numerics(i NUMERIC(), j NUMERIC)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE bla AS ENUM ();$TEST_PEG_PARSER$);
|
||||
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE type_int AS ENUM ('a','b');$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE type_int AS BIGINT;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE decs(i DEC())$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE decimals(i DECIMAL(), j DECIMAL)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TABLE numerics(i NUMERIC(), j NUMERIC)$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$CREATE TYPE bla AS ENUM ();$TEST_PEG_PARSER$);
|
||||
|
||||
19
external/duckdb/test/sql/peg_parser/update_statement.test
vendored
Normal file
19
external/duckdb/test/sql/peg_parser/update_statement.test
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# name: test/sql/peg_parser/update_statement.test
|
||||
# description: Test update statement in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$UPDATE temp.a SET i = 44$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$UPDATE foo SET (key, fruit, cost) = (1, 'pear', 2);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$UPDATE test t SET a=1$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$UPDATE foo t SET (key, fruit, cost) = (1, 'pear', 2);$TEST_PEG_PARSER$);
|
||||
|
||||
12
external/duckdb/test/sql/peg_parser/use_statement.test
vendored
Normal file
12
external/duckdb/test/sql/peg_parser/use_statement.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# name: test/sql/peg_parser/use_statement.test
|
||||
# description: Test use statement in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$use my_datalake.default;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select * from my_datalake.default.empty_table;$TEST_PEG_PARSER$);
|
||||
|
||||
20
external/duckdb/test/sql/peg_parser/window_function.test
vendored
Normal file
20
external/duckdb/test/sql/peg_parser/window_function.test
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# name: test/sql/peg_parser/window_function.test
|
||||
# description: Test window function syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$explain select first_value(i IGNORE NULLS) over () from integers;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select regr_avgx(v, v2) over (partition by k) from aggr;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$select regr_avgx(v, v2) over (w partition by k) from aggr;$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT sum(unique1) over (w range between unbounded preceding and current row exclude current row), unique1, four FROM tenk1d WINDOW w AS (order by four) ORDER BY four, unique1;$TEST_PEG_PARSER$);
|
||||
11
external/duckdb/test/sql/peg_parser/with_ordinality.test
vendored
Normal file
11
external/duckdb/test/sql/peg_parser/with_ordinality.test
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# name: test/sql/peg_parser/with_ordinality.test
|
||||
# description: Test with ordinality syntax in peg parser
|
||||
# group: [peg_parser]
|
||||
|
||||
require autocomplete
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$FROM foo() WITH ORDINALITY AS _(ordinality);$TEST_PEG_PARSER$);
|
||||
|
||||
statement ok
|
||||
CALL check_peg_parser($TEST_PEG_PARSER$SELECT a,my_range,my_ordinality FROM test AS t(a), LATERAL range(t.a) WITH ORDINALITY AS _(my_range,my_ordinality) ORDER BY a,my_range;$TEST_PEG_PARSER$);
|
||||
Reference in New Issue
Block a user