diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yql/essentials/tests/sql/suites/lineage | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/lineage')
59 files changed, 405 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/lineage/default.cfg b/yql/essentials/tests/sql/suites/lineage/default.cfg new file mode 100644 index 0000000000..d818ef972a --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/default.cfg @@ -0,0 +1,4 @@ +in Input input.txt +out Output output.txt +providers yt +canonize_lineage
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/error_type.cfg b/yql/essentials/tests/sql/suites/lineage/error_type.cfg new file mode 100644 index 0000000000..71212661a3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/error_type.cfg @@ -0,0 +1,5 @@ +in Input input.txt +out Output output.txt +providers yt +xfail + diff --git a/yql/essentials/tests/sql/suites/lineage/error_type.sql b/yql/essentials/tests/sql/suites/lineage/error_type.sql new file mode 100644 index 0000000000..21f12d6d0d --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/error_type.sql @@ -0,0 +1,13 @@ +USE plato; + +INSERT INTO Output +SELECT + 1 as foo +FROM Input + +UNION ALL + +SELECT + 'x' as foo +FROM Input + diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg b/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg new file mode 100644 index 0000000000..ed48d1a300 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/flatten_by.cfg @@ -0,0 +1 @@ +in Input input_list_2.txt diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_by.sql b/yql/essentials/tests/sql/suites/lineage/flatten_by.sql new file mode 100644 index 0000000000..16bc737177 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/flatten_by.sql @@ -0,0 +1,21 @@ +use plato; + +$subquery1 = +SELECT +key, subkey, z +FROM Input +FLATTEN LIST BY value as z; + +$subquery2 = +SELECT +key, subkey, value as z, value2 +FROM Input +FLATTEN LIST BY (value, value2); + +INSERT INTO @tmp1 WITH TRUNCATE +SELECT * +FROM $subquery1; + +INSERT INTO @tmp2 WITH TRUNCATE +SELECT * +FROM $subquery2;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg new file mode 100644 index 0000000000..0670741477 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.cfg @@ -0,0 +1,4 @@ +in Input input_list.txt +out Output output.txt +providers yt +canonize_lineage diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql new file mode 100644 index 0000000000..f534644d0d --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/flatten_list_nested_lambda.sql @@ -0,0 +1,19 @@ +USE plato; + +$sub = ( + select key + from Input + flatten list by + key +); + +insert into Output + select + value, + ListFilter( + [value], + ($x) -> ($x in $sub) + ) as f + from Input + order by value +
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/flatten_where.sql b/yql/essentials/tests/sql/suites/lineage/flatten_where.sql new file mode 100644 index 0000000000..8f2d499356 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/flatten_where.sql @@ -0,0 +1,11 @@ +USE plato; + +INSERT INTO Output +SELECT * FROM ( + SELECT + [key, key] as key2, + value + FROM Input + WHERE value > '' +) FLATTEN LIST BY key2 + diff --git a/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql b/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql new file mode 100644 index 0000000000..ea37605e02 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/group_by_asstruct_key.sql @@ -0,0 +1,10 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT x FROM ( +SELECT + <|a:key,b:value|> as x +FROM plato.Input +) +group by x +) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg b/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg new file mode 100644 index 0000000000..90436a56f9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/grouping_sets.cfg @@ -0,0 +1 @@ +in Input input_optional.txt diff --git a/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql b/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql new file mode 100644 index 0000000000..3bece90183 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql @@ -0,0 +1,17 @@ +USE plato; + +$data = select + key, subkey, value +from Input +group by GROUPING SETS ( + (key, subkey), + (subkey, value) + ); + +INSERT INTO @tmp WITH TRUNCATE +SELECT + b.value +FROM $data AS a +LEFT JOIN Input AS b +USING (key) +
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/if_struct.sql b/yql/essentials/tests/sql/suites/lineage/if_struct.sql new file mode 100644 index 0000000000..c8e9b16f0c --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/if_struct.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select * from (select IF(key == "foo", CombineMembers(RemoveMembers(LAG(data) OVER w, ["key"]), ChooseMembers(data, ["key"])), data) from + (select TableRow() as data, key, value from plato.Input) +window w as (partition by key)) flatten columns;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/input.txt b/yql/essentials/tests/sql/suites/lineage/input.txt new file mode 100644 index 0000000000..65949ea745 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="800";"subkey"="2";"value"="ddd"}; +{"key"="020";"subkey"="3";"value"="q"}; +{"key"="150";"subkey"="4";"value"="qzz"}; diff --git a/yql/essentials/tests/sql/suites/lineage/input.txt.attr b/yql/essentials/tests/sql/suites/lineage/input.txt.attr new file mode 100644 index 0000000000..36b3c00c90 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input.txt.attr @@ -0,0 +1,5 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[["key";["DataType";"String";];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];]; + } +} diff --git a/yql/essentials/tests/sql/suites/lineage/input_list.txt b/yql/essentials/tests/sql/suites/lineage/input_list.txt new file mode 100644 index 0000000000..16d6acaa78 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_list.txt @@ -0,0 +1,3 @@ +{"key"=["075";"800"];"subkey"="1";"value"="abc"}; +{"key"=["020";"150"];"subkey"="3";"value"="q"}; + diff --git a/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr new file mode 100644 index 0000000000..01a4a26d00 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_list.txt.attr @@ -0,0 +1,5 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[["key";["ListType";["DataType";"String";];];];["subkey";["DataType";"String";];];["value";["DataType";"String";];];];]; + } +} diff --git a/yql/essentials/tests/sql/suites/lineage/input_list_2.txt b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt new file mode 100644 index 0000000000..90e76c01fc --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt @@ -0,0 +1,3 @@ +{"key"="075";"subkey"="1";"value"=["abc";"cde"];"value2"=["efg"; "ghj"]}; +{"key"="020";"subkey"="3";"value"=["qqq";"ttt"];"value2"=["ppp";"rrr"]}; + diff --git a/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr new file mode 100644 index 0000000000..26fc5bf429 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_list_2.txt.attr @@ -0,0 +1,10 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String";];]; + ["subkey";["DataType";"String";];]; + ["value";["ListType";["DataType";"String";];];]; + ["value2";["ListType";["DataType";"String";];];]; + ];]; + } +} diff --git a/yql/essentials/tests/sql/suites/lineage/input_optional.txt b/yql/essentials/tests/sql/suites/lineage/input_optional.txt new file mode 100644 index 0000000000..f707788196 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_optional.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"=1}; +{"key"="800";"subkey"="2";"value"=2}; +{"key"="020";"subkey"="3";"value"=3}; +{"key"="150";"subkey"="4";"value"=4}; diff --git a/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr b/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr new file mode 100644 index 0000000000..b971d222d4 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/input_optional.txt.attr @@ -0,0 +1,5 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[["key";["OptionalType";["DataType";"String"]]];["subkey";["OptionalType";["DataType";"String"]]];["value";["OptionalType";["DataType";"Int64"];];];];]; + } +} diff --git a/yql/essentials/tests/sql/suites/lineage/isolated.sql b/yql/essentials/tests/sql/suites/lineage/isolated.sql new file mode 100644 index 0000000000..2bd18612e5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/isolated.sql @@ -0,0 +1,8 @@ +USE plato; + +$one = select dummy from as_table([<|dummy:1|>]); + +INSERT INTO Output +SELECT key FROM Input AS a +CROSS JOIN $one AS b; + diff --git a/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql b/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql new file mode 100644 index 0000000000..2bb80fe374 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/join_as_struct.sql @@ -0,0 +1,15 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT x,y FROM ( +SELECT + key, <|a:key,b:value|> as x +FROM plato.Input +) as a +JOIN ( +SELECT + key, <|c:key,d:value|> as y +FROM plato.Input +) as b +ON a.key = b.key +) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal1.sql b/yql/essentials/tests/sql/suites/lineage/list_literal1.sql new file mode 100644 index 0000000000..b839e4526b --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/list_literal1.sql @@ -0,0 +1,8 @@ +USE plato; + +$key = select min(key) from Input; + +INSERT INTO Output +SELECT +$key as key; + diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal2.sql b/yql/essentials/tests/sql/suites/lineage/list_literal2.sql new file mode 100644 index 0000000000..6fe5bf0773 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/list_literal2.sql @@ -0,0 +1,10 @@ +USE plato; + +$key = select min(key) from Input; + +INSERT INTO Output +SELECT * FROM ( + SELECT $key as key +) +where key > ''; + diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal3.sql b/yql/essentials/tests/sql/suites/lineage/list_literal3.sql new file mode 100644 index 0000000000..6344c18387 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/list_literal3.sql @@ -0,0 +1,12 @@ +USE plato; + +$key = select min(key) from Input; +$value = select min(value) from Input; + +INSERT INTO Output +SELECT * FROM ( + SELECT $key as key + UNION ALL + SELECT $value as val +) + diff --git a/yql/essentials/tests/sql/suites/lineage/list_literal4.sql b/yql/essentials/tests/sql/suites/lineage/list_literal4.sql new file mode 100644 index 0000000000..8ab9cafc82 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/list_literal4.sql @@ -0,0 +1,13 @@ +USE plato; + +$key = select min(key) from Input; +$value = select min(value) from Input; + +INSERT INTO Output +SELECT * FROM ( + SELECT $key as key + UNION ALL + SELECT $value as val +) +WHERE key > ''; + diff --git a/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql b/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql new file mode 100644 index 0000000000..ceaf6df9b9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/member_over_if_struct.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select * from (select IF(key == "foo", LAG(data) over w, data) from + (select TableRow() as data, key, value from plato.Input) +window w as (partition by key)) flatten columns;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql b/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql new file mode 100644 index 0000000000..9091bae31e --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/nested_lambda_fields.sql @@ -0,0 +1,18 @@ +USE plato; + +$v = ($x) -> { + return ListFilter(["a","b"],($y)->($y = $x)); +}; + +$k = ($x) -> { + return $x; +}; + + +insert into Output +with truncate +select + $k(key) as k, + $v(value) as v +from + Input diff --git a/yql/essentials/tests/sql/suites/lineage/process.sql b/yql/essentials/tests/sql/suites/lineage/process.sql new file mode 100644 index 0000000000..a97e7a237c --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/process.sql @@ -0,0 +1,8 @@ +USE plato; + +$p = ($s) -> ($s); + +INSERT INTO Output +PROCESS Input +USING $p(TableRows()); + diff --git a/yql/essentials/tests/sql/suites/lineage/reduce.sql b/yql/essentials/tests/sql/suites/lineage/reduce.sql new file mode 100644 index 0000000000..bc097c26af --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/reduce.sql @@ -0,0 +1,7 @@ +USE plato; + +$r = ($_key, $s) -> ($s); + +INSERT INTO Output +REDUCE Input +ON key USING $r(TableRow()); diff --git a/yql/essentials/tests/sql/suites/lineage/reduce_all.sql b/yql/essentials/tests/sql/suites/lineage/reduce_all.sql new file mode 100644 index 0000000000..aa16229644 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/reduce_all.sql @@ -0,0 +1,8 @@ +USE plato; + +$r = ($s) -> ($s); + +INSERT INTO Output +REDUCE Input +ON key USING ALL $r(TableRows()); + diff --git a/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql b/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql new file mode 100644 index 0000000000..21be7d15ed --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/reduce_all_row.sql @@ -0,0 +1,9 @@ +USE plato; + +$r = ($s) -> (Yql::FlatMap($s, ($x)->($x.1))); + +INSERT INTO Output +REDUCE Input +ON key USING ALL $r(TableRow()); + + diff --git a/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg b/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg new file mode 100644 index 0000000000..0670741477 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/scalar_context.cfg @@ -0,0 +1,4 @@ +in Input input_list.txt +out Output output.txt +providers yt +canonize_lineage diff --git a/yql/essentials/tests/sql/suites/lineage/scalar_context.sql b/yql/essentials/tests/sql/suites/lineage/scalar_context.sql new file mode 100644 index 0000000000..ef0f4d18f5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/scalar_context.sql @@ -0,0 +1,12 @@ +USE plato; + +$sub = ( + select key + from Input where value = 'abc' +); + +insert into Output + select + value, $sub as s + from Input + order by value diff --git a/yql/essentials/tests/sql/suites/lineage/select_all.sql b/yql/essentials/tests/sql/suites/lineage/select_all.sql new file mode 100644 index 0000000000..e83b513cf5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_all.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select * from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql b/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql new file mode 100644 index 0000000000..660930df9c --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_all_filter.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select * from plato.Input +where key > '' + diff --git a/yql/essentials/tests/sql/suites/lineage/select_field.sql b/yql/essentials/tests/sql/suites/lineage/select_field.sql new file mode 100644 index 0000000000..af706633d9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_field.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select key from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql b/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql new file mode 100644 index 0000000000..f07279fd60 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_field_filter.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select key from plato.Input +where key > '' + diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql b/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql new file mode 100644 index 0000000000..2d4e4d2d89 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_field_limit_offset.sql @@ -0,0 +1,6 @@ +insert into plato.Output +select key from plato.Input +order by key +limit 4 offset 1; + + diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql b/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql new file mode 100644 index 0000000000..6168ad6662 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_field_order_by.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select key, value from plato.Input +order by key; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql b/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql new file mode 100644 index 0000000000..deebad403e --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_field_rename.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select key as key2 from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql b/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql new file mode 100644 index 0000000000..f0d0e6abd1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_group_by_all.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select count(*), min(value) from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql b/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql new file mode 100644 index 0000000000..1c9e4b383d --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_group_by_key.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select key, count(*), min(value) from plato.Input group by key order by key; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_join.sql b/yql/essentials/tests/sql/suites/lineage/select_join.sql new file mode 100644 index 0000000000..fce7a756e2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_join.sql @@ -0,0 +1,5 @@ +insert into plato.Output +select a.key as x, b.value as y from plato.Input as a +join plato.Input as b on a.key = b.key +order by x; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql b/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql new file mode 100644 index 0000000000..61033e1f87 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_mix_fields.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select key || value from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql b/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql new file mode 100644 index 0000000000..adcc6c3619 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_nested_table_row.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select StablePickle(TableRow()) from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_table_row.sql b/yql/essentials/tests/sql/suites/lineage/select_table_row.sql new file mode 100644 index 0000000000..ca19dafd36 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_table_row.sql @@ -0,0 +1,3 @@ +insert into plato.Output +select TableRow() from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/select_union_all.sql b/yql/essentials/tests/sql/suites/lineage/select_union_all.sql new file mode 100644 index 0000000000..24a56b8454 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/select_union_all.sql @@ -0,0 +1,5 @@ +insert into plato.Output +select key as x from plato.Input +union all +select value as x from plato.Input; + diff --git a/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql new file mode 100644 index 0000000000..6edbc01dce --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/some_tablerow.sql @@ -0,0 +1,6 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT + some(TableRow()) +FROM plato.Input) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/topsort.sql b/yql/essentials/tests/sql/suites/lineage/topsort.sql new file mode 100644 index 0000000000..2289cb02b1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/topsort.sql @@ -0,0 +1,8 @@ +USE plato; + +INSERT INTO Output +SELECT a.value +FROM Input AS a +INNER JOIN (SELECT value FROM Input ORDER BY value LIMIT 1) AS b +USING (value); + diff --git a/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql new file mode 100644 index 0000000000..c2d3407e9e --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/union_all_tablerow.sql @@ -0,0 +1,11 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT + TableRow() as x +FROM plato.Input +UNION ALL +SELECT + 1 as y +FROM plato.Input +) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql b/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql new file mode 100644 index 0000000000..d7b657468d --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/unordered_subquery.sql @@ -0,0 +1,9 @@ +USE plato; + +define subquery $f() as + SELECT * FROM Input +end define; + +insert into Output with truncate + select * from $f() + diff --git a/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql b/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql new file mode 100644 index 0000000000..3a65047285 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_asstruct.sql @@ -0,0 +1,6 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT + lead(<|a:key,b:value|>) over () +FROM plato.Input) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/window_many.sql b/yql/essentials/tests/sql/suites/lineage/window_many.sql new file mode 100644 index 0000000000..5fe93a4226 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_many.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select key, row_number() over w1, lag(value) over w1, lead(value) over w1, + rank(value) over w2, dense_rank(value) over w2 + from plato.Input window w1 as (order by key), w2 as (order by key desc)
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql b/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql new file mode 100644 index 0000000000..ff33cb8542 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_member_struct.sql @@ -0,0 +1,4 @@ +insert into plato.Output WITH TRUNCATE +select * from (select lag(data) over w from + (select TableRow() as data, key from plato.Input) +window w as (partition by key)) flatten columns; diff --git a/yql/essentials/tests/sql/suites/lineage/window_one.sql b/yql/essentials/tests/sql/suites/lineage/window_one.sql new file mode 100644 index 0000000000..6bd40dc505 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_one.sql @@ -0,0 +1,2 @@ +insert into plato.Output +select key, row_number() over () from plato.Input
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/lineage/window_session.sql b/yql/essentials/tests/sql/suites/lineage/window_session.sql new file mode 100644 index 0000000000..74ba0f70d1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_session.sql @@ -0,0 +1,4 @@ +insert into plato.Output +select key, row_number() over w as r, session_start() over w as s from plato.Input +window w AS (PARTITION BY key, SessionWindow(cast(subkey as Datetime), DateTime::IntervalFromMinutes(15))); + diff --git a/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql b/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql new file mode 100644 index 0000000000..e96be1ecfb --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/window_tablerow.sql @@ -0,0 +1,6 @@ +INSERT INTO plato.Output +SELECT * FROM ( +SELECT + lead(TableRow()) over () +FROM plato.Input) +flatten columns diff --git a/yql/essentials/tests/sql/suites/lineage/with_inline.sql b/yql/essentials/tests/sql/suites/lineage/with_inline.sql new file mode 100644 index 0000000000..2c98d76f82 --- /dev/null +++ b/yql/essentials/tests/sql/suites/lineage/with_inline.sql @@ -0,0 +1,8 @@ +USE plato; + +INSERT INTO Output +SELECT +key as key, +"" as subkey, +"value:" || value as value +FROM Input WITH INLINE |