diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/s-expressions/suites/EquiJoinAny | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/s-expressions/suites/EquiJoinAny')
21 files changed, 309 insertions, 0 deletions
diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql new file mode 100644 index 0000000000..283fccceff --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAllAny.yql @@ -0,0 +1,9 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql new file mode 100644 index 0000000000..af7dbd189d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAll.yql @@ -0,0 +1,9 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql new file mode 100644 index 0000000000..e8016a1260 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/CommonAnyAny.yql @@ -0,0 +1,9 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt new file mode 100644 index 0000000000..ebf3709fbe --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/DoAllJoinsExceptCross.yql.txt @@ -0,0 +1,54 @@ +( + +(let doAllJoinsExceptCrossEx (lambda '(world list1 list2 link) ( block '( + + (let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinLeft (EquiJoin '(list1 'a) '(list2 'b) '('Left 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinRight (EquiJoin '(list1 'a) '(list2 'b) '('Right 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinFull (EquiJoin '(list1 'a) '(list2 'b) '('Full 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinLeftOnly (EquiJoin '(list1 'a) '(list2 'b) '('LeftOnly 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinRightOnly (EquiJoin '(list1 'a) '(list2 'b) '('RightOnly 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinExclusion (EquiJoin '(list1 'a) '(list2 'b) '('Exclusion 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinLeftSemi (EquiJoin '(list1 'a) '(list2 'b) '('LeftSemi 'a 'b '('a 'key) '('b 'key) link) '())) + (let joinRightSemi (EquiJoin '(list1 'a) '(list2 'b) '('RightSemi 'a 'b '('a 'key) '('b 'key) link) '())) + + (let sortDir2 '((Bool 'true) (Bool 'true))) + (let sortDir1 '((Bool 'true))) + (let keySelectorAB (lambda '(row) '((Member row '"a.key") (Member row '"b.key")))) + (let keySelectorA (lambda '(row) '((Member row '"a.key")))) + (let keySelectorB (lambda '(row) '((Member row '"b.key")))) + + (let res_sink (DataSink 'result)) + (let world (Write! world res_sink (Key) (Sort joinInner sortDir2 keySelectorAB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinLeft sortDir2 keySelectorAB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinRight sortDir2 keySelectorAB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinFull sortDir2 keySelectorAB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinLeftOnly sortDir1 keySelectorA) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinRightOnly sortDir1 keySelectorB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinExclusion sortDir2 keySelectorAB) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinLeftSemi sortDir1 keySelectorA) '('('type)))) + (let world (Write! world res_sink (Key) (Sort joinRightSemi sortDir1 keySelectorB) '('('type)))) + + (let world (Commit! world res_sink)) + (return world) + +)))) + +(let doAllJoinsExceptCrossLink (lambda '(world t1 t2 link) ( block '( + (let mr_source (DataSource 'yt 'plato)) + (let x (Read! world mr_source (Key '('table (String t1))) (Void) '())) + (let world (Left! x)) + (let list1 (Right! x)) + + (let x (Read! world mr_source (Key '('table (String t2))) (Void) '())) + (let world (Left! x)) + (let list2 (Right! x)) + + (return (Apply doAllJoinsExceptCrossEx world list1 list2 link)) +)))) + + +(export doAllJoinsExceptCrossLink) +(export doAllJoinsExceptCrossEx) + +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql new file mode 100644 index 0000000000..0db96ff654 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAllAny.yql @@ -0,0 +1,31 @@ +( +(library "joins.yql") +(import join_module '"joins.yql") + +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +# Same as InputKV1 +(let list1 (AsList + (AsStruct '('key (String '1)) '('v1 (String 'v11))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) +)) + +# Same as InputKV2 +(let list2 (AsList + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes))) +)) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql new file mode 100644 index 0000000000..42b1a60840 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAll.yql @@ -0,0 +1,31 @@ +( +(library "joins.yql") +(import join_module '"joins.yql") + +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +# Same as InputKV1 +(let list1 (AsList + (AsStruct '('key (String '1)) '('v1 (String 'v11))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) +)) + +# Same as InputKV2 +(let list2 (AsList + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes))) +)) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('left 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql new file mode 100644 index 0000000000..53b2d9eaae --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InMemAnyAny.yql @@ -0,0 +1,31 @@ +( +(library "joins.yql") +(import join_module '"joins.yql") + +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +# Same as InputKV1 +(let list1 (AsList + (AsStruct '('key (String '1)) '('v1 (String 'v11))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '2)) '('v1 (String 'v12))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) + (AsStruct '('key (String '3)) '('v1 (String 'v13))) +)) + +# Same as InputKV2 +(let list2 (AsList + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '2)) '('v2 (String 'v22_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '3)) '('v2 (String 'v23_extra_bytes))) + (AsStruct '('key (String '4)) '('v2 (String 'v24_extra_bytes))) +)) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossEx) world list1 list2 '('('left 'any) '('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt new file mode 100644 index 0000000000..895634d4f4 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt @@ -0,0 +1,6 @@ +{"key"="1";"v1"="v11"}; +{"key"="2";"v1"="v12"}; +{"key"="2";"v1"="v12"}; +{"key"="2";"v1"="v12"}; +{"key"="3";"v1"="v13"}; +{"key"="3";"v1"="v13"}; diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr new file mode 100644 index 0000000000..25b39416e2 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV1.txt.attr @@ -0,0 +1,10 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String"]]; + ["v1";["DataType";"String"]] + ]]; + "SortDirections"=[1;]; + "SortedBy"=["key";]; + "SortedByTypes"=[["DataType";"String";];]; + "SortMembers"=["key";]; +}} diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt new file mode 100644 index 0000000000..b2ee98b41a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt @@ -0,0 +1,6 @@ +{"key"="2";"v2"="v22_extra_bytes"}; +{"key"="2";"v2"="v22_extra_bytes"}; +{"key"="3";"v2"="v23_extra_bytes"}; +{"key"="3";"v2"="v23_extra_bytes"}; +{"key"="3";"v2"="v23_extra_bytes"}; +{"key"="4";"v2"="v24_extra_bytes"}; diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr new file mode 100644 index 0000000000..ca25d0f371 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/InputKV2.txt.attr @@ -0,0 +1,10 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String"]]; + ["v2";["DataType";"String"]] + ]]; + "SortDirections"=[1;]; + "SortedBy"=["key";]; + "SortedByTypes"=[["DataType";"String";];]; + "SortMembers"=["key";]; +}} diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql new file mode 100644 index 0000000000..cca73e9d75 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAllAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql new file mode 100644 index 0000000000..e9547bfd31 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAll.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql new file mode 100644 index 0000000000..e5bc5906b3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/LookupAnyAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"lookupjoinlimit" '"64k")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql new file mode 100644 index 0000000000..ad84352890 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAllAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql new file mode 100644 index 0000000000..037e8aafc0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAll.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql new file mode 100644 index 0000000000..f1ce069c3e --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MapAnyAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"mapjoinlimit" '"1m")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql new file mode 100644 index 0000000000..5845432182 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAllAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql new file mode 100644 index 0000000000..5f12b8e34e --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAll.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql new file mode 100644 index 0000000000..eaad119c21 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/MergeAnyAny.yql @@ -0,0 +1,11 @@ +( + +(library "joins.yql") +(import join_module '"joins.yql") + +(let world (Configure! world (DataSource '"yt" '"$all") '"Attr" '"joinmergetableslimit" '"10")) + +(let world (Apply (bind join_module 'doAllJoinsExceptCrossLink) world 'Input1 'Input2 '('('left 'any) '('right 'any)))) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg new file mode 100644 index 0000000000..c73c7f566e --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/EquiJoinAny/default.cfg @@ -0,0 +1,4 @@ +res result.txt +file joins.yql DoAllJoinsExceptCross.yql.txt +in Input1 InputKV1.txt +in Input2 InputKV2.txt |