diff options
author | udovichenko-r <udovichenko-r@yandex-team.com> | 2024-11-19 14:58:38 +0300 |
---|---|---|
committer | udovichenko-r <udovichenko-r@yandex-team.com> | 2024-11-19 15:16:27 +0300 |
commit | 24521403b1c44303e043ba540c09b1fe991c7474 (patch) | |
tree | 341d1e7206bc7c143d04d2d96f05b6dc0655606d /yql/essentials/tests/sql/suites/stream_lookup_join | |
parent | 72b3cd51dc3fb9d16975d353ea82fd85701393cc (diff) | |
download | ydb-24521403b1c44303e043ba540c09b1fe991c7474.tar.gz |
YQL-19206 Move contrib/ydb/library/yql/tests/sql/suites -> yql/essentials/tests/sql/suites
commit_hash:d0ef1f92b09c94db7c2408f946d2a4c62b603f00
Diffstat (limited to 'yql/essentials/tests/sql/suites/stream_lookup_join')
9 files changed, 104 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg b/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg new file mode 100644 index 0000000000..13ec07f2a3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/default.cfg @@ -0,0 +1,4 @@ +in Input input.txt +in Event event.txt +in Host host.txt +providers dq diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt new file mode 100644 index 0000000000..0c6dd06751 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt @@ -0,0 +1,30 @@ +{"host"="host0";"id"="id_0";"net"="net0";"ts"=1716739200u;"type"="type_0";"user"="host0"}; +{"host"="host1";"id"="id_1";"net"="net1";"ts"=1716739201u;"type"="type_1";"user"="host1"}; +{"host"="host2";"id"="id_2";"net"="net2";"ts"=1716739202u;"type"="type_2";"user"="host2"}; +{"host"="host3";"id"="id_3";"net"="net3";"ts"=1716739203u;"type"="type_3";"user"="host3"}; +{"host"="host4";"id"="id_4";"net"="net0";"ts"=1716739204u;"type"="type_4";"user"="host4"}; +{"host"="host5";"id"="id_5";"net"="net1";"ts"=1716739205u;"type"="type_5";"user"="host0"}; +{"host"="host6";"id"="id_6";"net"="net2";"ts"=1716739206u;"type"="type_6";"user"="host1"}; +{"host"="host7";"id"="id_7";"net"="net3";"ts"=1716739207u;"type"="type_0";"user"="host2"}; +{"host"="host8";"id"="id_8";"net"="net0";"ts"=1716739208u;"type"="type_1";"user"="host3"}; +{"host"="very very long hostname to for test 1";"id"="id_9";"net"="net1";"ts"=1716739209u;"type"="type_2";"user"="host4"}; +{"host"="host0";"id"="id_10";"net"="net2";"ts"=1716739210u;"type"="type_3";"user"="host0"}; +{"host"="host1";"id"="id_11";"net"="net3";"ts"=1716739211u;"type"="type_4";"user"="host1"}; +{"host"="host2";"id"="id_12";"net"="net0";"ts"=1716739212u;"type"="type_5";"user"="host2"}; +{"host"="host3";"id"="id_13";"net"="net1";"ts"=1716739213u;"type"="type_6";"user"="host3"}; +{"host"="host4";"id"="id_14";"net"="net2";"ts"=1716739214u;"type"="type_0";"user"="host4"}; +{"host"="host5";"id"="id_15";"net"="net3";"ts"=1716739215u;"type"="type_1";"user"="host0"}; +{"host"="host6";"id"="id_16";"net"="net0";"ts"=1716739216u;"type"="type_2";"user"="host1"}; +{"host"="host7";"id"="id_17";"net"="net1";"ts"=1716739217u;"type"="type_3";"user"="host2"}; +{"host"="host8";"id"="id_18";"net"="net2";"ts"=1716739218u;"type"="type_4";"user"="host3"}; +{"host"="host9";"id"="id_19";"net"="net3";"ts"=1716739219u;"type"="type_5";"user"="host4"}; +{"host"="host0";"id"="id_20";"net"="net0";"ts"=1716739220u;"type"="type_6";"user"="host0"}; +{"host"="host1";"id"="id_21";"net"="net1";"ts"=1716739221u;"type"="type_0";"user"="host1"}; +{"host"="host2";"id"="id_22";"net"="net2";"ts"=1716739222u;"type"="type_1";"user"="host2"}; +{"host"="host3";"id"="id_23";"net"="net3";"ts"=1716739223u;"type"="type_2";"user"="host3"}; +{"host"="host4";"id"="id_24";"net"="net0";"ts"=1716739224u;"type"="type_3";"user"="host4"}; +{"host"="host5";"id"="id_25";"net"="net1";"ts"=1716739225u;"type"="type_4";"user"="host0"}; +{"host"="host6";"id"="id_26";"net"="net2";"ts"=1716739226u;"type"="type_5";"user"="host1"}; +{"host"="host7";"id"="id_27";"net"="net3";"ts"=1716739227u;"type"="type_6";"user"="host2"}; +{"host"="host8";"id"="id_28";"net"="net0";"ts"=1716739228u;"type"="type_0";"user"="host3"}; +{"host"="host9";"id"="id_29";"net"="net1";"ts"=1716739229u;"type"="type_1";"user"="host4"}; diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr new file mode 100644 index 0000000000..7dd7675ed1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/event.txt.attr @@ -0,0 +1,10 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["id";["DataType";"String"]]; + ["ts";["DataType";"Datetime"]]; + ["type";["DataType";"String"]]; + ["host";["DataType";"String"]]; + ["net";["DataType";"String"]]; + ["user";["DataType";"String"]] + ]]; +}} diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt new file mode 100644 index 0000000000..793da43db5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt @@ -0,0 +1,11 @@ +{"hostname"="host1";"fqdn"="fqdn1.net";"ip4"="192.168.0.1"; "ip6"="[xxxx:xxxx:xxxx:1111]"}; +{"hostname"="host2";"fqdn"="fqdn2.net";"ip4"="192.168.0.2"; "ip6"="[xxxx:xxxx:xxxx:2222]"}; +{"hostname"="host3";"fqdn"="fqdn3.net";"ip4"="192.168.0.3"; "ip6"="[xxxx:xxxx:xxxx:3333]"}; +{"hostname"="host4";"fqdn"="fqdn4.net";"ip4"="192.168.0.4"; "ip6"="[xxxx:xxxx:xxxx:4444]"}; +{"hostname"="host5";"fqdn"="fqdn5.net";"ip4"="192.168.0.5"; "ip6"="[xxxx:xxxx:xxxx:5555]"}; +{"hostname"="host6";"fqdn"="fqdn6.net";"ip4"="192.168.0.6"; "ip6"="[xxxx:xxxx:xxxx:6666]"}; +{"hostname"="host7";"fqdn"="fqdn7.net";"ip4"="192.168.0.7"; "ip6"="[xxxx:xxxx:xxxx:7777]"}; +{"hostname"="host8";"fqdn"="fqdn8.net";"ip4"="192.168.0.8"; "ip6"="[xxxx:xxxx:xxxx:8888]"}; +{"hostname"="very very long hostname to for test 1";"fqdn"="very very long fqdn for test 1";"ip4"="192.168.100.1"; "ip6"="[xxxx:xxxx:XXXX:1111]"}; +{"hostname"="very very long hostname to for test 2";"fqdn"="very very long fqdn for test 2";"ip4"="192.168.100.2"; "ip6"="[xxxx:xxxx:XXXX:2222]"}; + diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr new file mode 100644 index 0000000000..2206fffce8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/host.txt.attr @@ -0,0 +1,8 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["hostname";["DataType";"String"]]; + ["fqdn";["DataType";"String"]]; + ["ip4";["DataType";"String"]]; + ["ip6";["DataType";"String"]] + ]]; +}} diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt new file mode 100644 index 0000000000..b214aab0d9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt @@ -0,0 +1,10 @@ +{"key"="023";"subkey"="3";"value"="aaa"}; +{"key"="037";"subkey"="5";"value"="ddd"}; +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="150";"subkey"="1";"value"="aaa"}; +{"key"="150";"subkey"="3";"value"="iii"}; +{"key"="150";"subkey"="8";"value"="zzz"}; +{"key"="200";"subkey"="7";"value"="qqq"}; +{"key"="527";"subkey"="4";"value"="bbb"}; +{"key"="761";"subkey"="6";"value"="ccc"}; +{"key"="911";"subkey"="2";"value"="kkk"}; diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr new file mode 100644 index 0000000000..7a11b85b77 --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/input.txt.attr @@ -0,0 +1,13 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["key"; ["DataType"; "String"]]; + ["subkey"; ["DataType"; "String"]]; + ["value"; ["DataType"; "String"]]; + ]]; + "SortMembers"=["key"; "subkey"]; + "SortedBy"=["key"; "subkey"]; + "SortDirections"=[1; 1]; + "SortedByTypes"=[["DataType";"String"]; ["DataType";"String"]] + }; +} diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql new file mode 100644 index 0000000000..84eed2af7e --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join.sql @@ -0,0 +1,9 @@ +pragma dq.UseWideChannels = "true"; +use plato; + +select e.id as id, e.ts as ts, e.host as host, h.fqdn as fqdn, h.ip4 as ip4, h.ip6 as ip6 + from Event as e + left join /*+ streamlookup() */ Host as h + on (e.host == h.hostname) +; + diff --git a/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql new file mode 100644 index 0000000000..e2ff789e2f --- /dev/null +++ b/yql/essentials/tests/sql/suites/stream_lookup_join/lookup_join_narrow.sql @@ -0,0 +1,9 @@ +pragma dq.UseWideChannels = "false"; +use plato; + +select e.id as id, e.ts as ts, e.host as host, h.fqdn as fqdn, h.ip4 as ip4, h.ip6 as ip6 + from Event as e + left join /*+ streamlookup() */ Host as h + on (e.host == h.hostname) +; + |