aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Stoyan <vvvv@ydb.tech>2024-10-18 20:09:13 +0300
committerGitHub <noreply@github.com>2024-10-18 17:09:13 +0000
commitae2d0326778df5dba2017223b85f7014ebd39d15 (patch)
tree54d177cced10fd773b8b860b5ab29f7c3ab10563
parent93e2e233dbb15879f54885174b20f258260cd2a8 (diff)
downloadydb-ae2d0326778df5dba2017223b85f7014ebd39d15.tar.gz
Fixed IN with tuple input in some cases (#10605)
-rw-r--r--ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp6
-rw-r--r--ydb/library/yql/core/yql_expr_type_annotation.cpp42
-rw-r--r--ydb/library/yql/tests/sql/dq_file/part13/canondata/result.json22
-rw-r--r--ydb/library/yql/tests/sql/dq_file/part18/canondata/result.json22
-rw-r--r--ydb/library/yql/tests/sql/dq_file/part6/canondata/result.json22
-rw-r--r--ydb/library/yql/tests/sql/dq_file/part9/canondata/result.json22
-rw-r--r--ydb/library/yql/tests/sql/hybrid_file/part10/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/hybrid_file/part6/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/hybrid_file/part8/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/hybrid_file/part9/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/sql2yql/canondata/result.json28
-rw-r--r--ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg1
-rw-r--r--ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.cfg1
-rw-r--r--ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.sql10
-rw-r--r--ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg1
-rw-r--r--ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.cfg1
-rw-r--r--ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.sql5
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part13/canondata/result.json21
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part18/canondata/result.json21
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part6/canondata/result.json21
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part9/canondata/result.json21
21 files changed, 314 insertions, 9 deletions
diff --git a/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp b/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp
index e88e436f12..c70c7df944 100644
--- a/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp
+++ b/ydb/library/yql/core/peephole_opt/yql_opt_peephole_physical.cpp
@@ -1974,13 +1974,12 @@ TExprNode::TPtr ExpandSqlIn(const TExprNode::TPtr& input, TExprContext& ctx) {
auto collection = input->HeadPtr();
auto lookup = input->ChildPtr(1);
auto options = input->ChildPtr(2);
+ const bool nullableCollectionItems = IsSqlInCollectionItemsNullable(NNodes::TCoSqlIn(input));
const bool ansiIn = HasSetting(*options, "ansi");
const bool tableSource = HasSetting(*options, "tableSource");
static const size_t MaxCollectionItemsToExpandAsOrChain = 5;
- const bool hasOptionals = collection->GetTypeAnn()->HasOptionalOrNull() ||
- lookup->GetTypeAnn()->HasOptionalOrNull();
- if (ansiIn || !hasOptionals) {
+ if (ansiIn || !nullableCollectionItems) {
const size_t collectionSize = collection->ChildrenSize();
if ((collection->IsCallable("AsList") || collection->IsList()) &&
collectionSize <= MaxCollectionItemsToExpandAsOrChain &&
@@ -2068,7 +2067,6 @@ TExprNode::TPtr ExpandSqlIn(const TExprNode::TPtr& input, TExprContext& ctx) {
.Build();
}
- const bool nullableCollectionItems = IsSqlInCollectionItemsNullable(NNodes::TCoSqlIn(input));
if (ansiIn && (nullableCollectionItems || lookupType->HasOptionalOrNull())) {
YQL_CLOG(DEBUG, CorePeepHole) << "ANSI IN: with nullable items in collection or lookup";
YQL_ENSURE(dict);
diff --git a/ydb/library/yql/core/yql_expr_type_annotation.cpp b/ydb/library/yql/core/yql_expr_type_annotation.cpp
index c84c9a3c9c..d397db703e 100644
--- a/ydb/library/yql/core/yql_expr_type_annotation.cpp
+++ b/ydb/library/yql/core/yql_expr_type_annotation.cpp
@@ -4924,21 +4924,53 @@ bool IsSqlInCollectionItemsNullable(const NNodes::TCoSqlIn& node) {
collectionType = collectionType->Cast<TOptionalExprType>()->GetItemType();
}
+ auto lookupType = node.Lookup().Ref().GetTypeAnn();
+
const auto collectionKind = collectionType->GetKind();
bool result = false;
switch (collectionKind) {
case ETypeAnnotationKind::Tuple:
{
const auto tupleType = collectionType->Cast<TTupleExprType>();
- result = AnyOf(tupleType->GetItems(), [](const auto& item) { return item->HasOptionalOrNull(); } );
+ for (const auto& item : tupleType->GetItems()) {
+ if (item->HasOptionalOrNull()) {
+ result = true;
+ break;
+ }
+
+ auto cmp = CanCompare<true>(lookupType, item);
+ if (cmp == ECompareOptions::Optional || cmp == ECompareOptions::Null) {
+ result = true;
+ break;
+ }
+ }
+
break;
}
- case ETypeAnnotationKind::Dict:
- result = collectionType->Cast<TDictExprType>()->GetKeyType()->HasOptionalOrNull();
+ case ETypeAnnotationKind::Dict: {
+ if (collectionType->Cast<TDictExprType>()->GetKeyType()->HasOptionalOrNull()) {
+ result = true;
+ } else {
+ auto cmp = CanCompare<true>(lookupType, collectionType->Cast<TDictExprType>()->GetKeyType());
+ if (cmp == ECompareOptions::Optional || cmp == ECompareOptions::Null) {
+ result = true;
+ }
+ }
+
break;
- case ETypeAnnotationKind::List:
- result = collectionType->Cast<TListExprType>()->GetItemType()->HasOptionalOrNull();
+ }
+ case ETypeAnnotationKind::List: {
+ if (collectionType->Cast<TListExprType>()->GetItemType()->HasOptionalOrNull()) {
+ result = true;
+ } else {
+ auto cmp = CanCompare<true>(lookupType, collectionType->Cast<TListExprType>()->GetItemType());
+ if (cmp == ECompareOptions::Optional || cmp == ECompareOptions::Null) {
+ result = true;
+ }
+ }
+
break;
+ }
case ETypeAnnotationKind::EmptyDict:
case ETypeAnnotationKind::EmptyList:
case ETypeAnnotationKind::Null:
diff --git a/ydb/library/yql/tests/sql/dq_file/part13/canondata/result.json b/ydb/library/yql/tests/sql/dq_file/part13/canondata/result.json
index 89cb8bf818..e6d88c0957 100644
--- a/ydb/library/yql/tests/sql/dq_file/part13/canondata/result.json
+++ b/ydb/library/yql/tests/sql/dq_file/part13/canondata/result.json
@@ -1017,6 +1017,28 @@
}
],
"test.test[in-in_with_nulls_and_optionals_extra-default.txt-Results]": [],
+ "test.test[in-large_in_YQL-19183--Analyze]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1881367/03ce4da085261f32ea1c441399858f72350f0970/resource.tar.gz#test.test_in-large_in_YQL-19183--Analyze_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Debug]": [
+ {
+ "checksum": "6cd461af12a4f4f8bf6d3b148d669f25",
+ "size": 594,
+ "uri": "https://{canondata_backend}/1881367/03ce4da085261f32ea1c441399858f72350f0970/resource.tar.gz#test.test_in-large_in_YQL-19183--Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1881367/03ce4da085261f32ea1c441399858f72350f0970/resource.tar.gz#test.test_in-large_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Results]": [],
"test.test[insert-append_sorted-to_sorted-Analyze]": [
{
"checksum": "c81430c2e09d6c34d9891ba4daf09f31",
diff --git a/ydb/library/yql/tests/sql/dq_file/part18/canondata/result.json b/ydb/library/yql/tests/sql/dq_file/part18/canondata/result.json
index 03241d2fa4..ab8337cf7e 100644
--- a/ydb/library/yql/tests/sql/dq_file/part18/canondata/result.json
+++ b/ydb/library/yql/tests/sql/dq_file/part18/canondata/result.json
@@ -1145,6 +1145,28 @@
"uri": "file://test.test_flatten_by-flatten_dict--Results_/extracted"
}
],
+ "test.test[in-small_in_YQL-19183-ansi-Analyze]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/7dffac89ce1ad5b85a289c1c8f6a474e7e3a9362/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Analyze_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "b5a738dd6b40400b6bf4fff3c1e67b6c",
+ "size": 421,
+ "uri": "https://{canondata_backend}/1903885/7dffac89ce1ad5b85a289c1c8f6a474e7e3a9362/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/7dffac89ce1ad5b85a289c1c8f6a474e7e3a9362/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Results]": [],
"test.test[insert-append_missing_null-default.txt-Analyze]": [
{
"checksum": "b591e16de5b80ad56b57d82981336873",
diff --git a/ydb/library/yql/tests/sql/dq_file/part6/canondata/result.json b/ydb/library/yql/tests/sql/dq_file/part6/canondata/result.json
index 9d38e62bd4..84ea219de1 100644
--- a/ydb/library/yql/tests/sql/dq_file/part6/canondata/result.json
+++ b/ydb/library/yql/tests/sql/dq_file/part6/canondata/result.json
@@ -1210,6 +1210,28 @@
}
],
"test.test[in-in_with_tuple-default.txt-Results]": [],
+ "test.test[in-large_in_YQL-19183-ansi-Analyze]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1881367/e98bbd650c45a3f4f6bc628cf8be62baa88c6183/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Analyze_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "42f246b79cfdf472d0e1b1b2a2906325",
+ "size": 541,
+ "uri": "https://{canondata_backend}/1881367/e98bbd650c45a3f4f6bc628cf8be62baa88c6183/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1881367/e98bbd650c45a3f4f6bc628cf8be62baa88c6183/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Results]": [],
"test.test[insert-after_group_by-default.txt-Analyze]": [
{
"checksum": "96a53f8e3a065123498005c527be5309",
diff --git a/ydb/library/yql/tests/sql/dq_file/part9/canondata/result.json b/ydb/library/yql/tests/sql/dq_file/part9/canondata/result.json
index c8729847bc..7dadc787ac 100644
--- a/ydb/library/yql/tests/sql/dq_file/part9/canondata/result.json
+++ b/ydb/library/yql/tests/sql/dq_file/part9/canondata/result.json
@@ -1082,6 +1082,28 @@
}
],
"test.test[in-in_immediate_subquery-default.txt-Results]": [],
+ "test.test[in-small_in_YQL-19183--Analyze]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/36b7eb9d918e0ee90b18e7dfac3ec36336c26b5e/resource.tar.gz#test.test_in-small_in_YQL-19183--Analyze_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Debug]": [
+ {
+ "checksum": "fe842b7683cf32fe6a3cad94653770f3",
+ "size": 474,
+ "uri": "https://{canondata_backend}/1903885/36b7eb9d918e0ee90b18e7dfac3ec36336c26b5e/resource.tar.gz#test.test_in-small_in_YQL-19183--Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/36b7eb9d918e0ee90b18e7dfac3ec36336c26b5e/resource.tar.gz#test.test_in-small_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Results]": [],
"test.test[insert-keepmeta-view_fail-Results]": [
{
"uri": "file://test.test_insert-keepmeta-view_fail-Results_/extracted"
diff --git a/ydb/library/yql/tests/sql/hybrid_file/part10/canondata/result.json b/ydb/library/yql/tests/sql/hybrid_file/part10/canondata/result.json
index bf58fa0679..5bfe8ca33c 100644
--- a/ydb/library/yql/tests/sql/hybrid_file/part10/canondata/result.json
+++ b/ydb/library/yql/tests/sql/hybrid_file/part10/canondata/result.json
@@ -1245,6 +1245,20 @@
"uri": "https://{canondata_backend}/1130705/2dbc543e7e2156e1086b7eff9aaab72ade9022c4/resource.tar.gz#test.test_in-in_with_list_dict-default.txt-Plan_/plan.txt"
}
],
+ "test.test[in-large_in_YQL-19183--Debug]": [
+ {
+ "checksum": "9cf3548e7c262c9a9f1d9fd7924cfb92",
+ "size": 593,
+ "uri": "https://{canondata_backend}/1881367/943a50aaa7841517b3581cb3efc1c4693dfe6c56/resource.tar.gz#test.test_in-large_in_YQL-19183--Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1881367/943a50aaa7841517b3581cb3efc1c4693dfe6c56/resource.tar.gz#test.test_in-large_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
"test.test[insert-merge_publish--Debug]": [
{
"checksum": "64ebc7e15210475430faab9682fa1c41",
diff --git a/ydb/library/yql/tests/sql/hybrid_file/part6/canondata/result.json b/ydb/library/yql/tests/sql/hybrid_file/part6/canondata/result.json
index 841c8a5954..ccf8a438de 100644
--- a/ydb/library/yql/tests/sql/hybrid_file/part6/canondata/result.json
+++ b/ydb/library/yql/tests/sql/hybrid_file/part6/canondata/result.json
@@ -1231,6 +1231,20 @@
"uri": "https://{canondata_backend}/1937001/601e94a23ec26980c16840b1ec99d6084037513f/resource.tar.gz#test.test_in-in_with_tuple-default.txt-Plan_/plan.txt"
}
],
+ "test.test[in-small_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "8e81ddca5e2463a69f21ae340d099230",
+ "size": 420,
+ "uri": "https://{canondata_backend}/1903885/c99336662dd85cc4dbf2e30aa3726a822664376a/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/c99336662dd85cc4dbf2e30aa3726a822664376a/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
"test.test[in-yql-14677-default.txt-Debug]": [
{
"checksum": "e73c4edd15205a000c7c8527253ea6ad",
diff --git a/ydb/library/yql/tests/sql/hybrid_file/part8/canondata/result.json b/ydb/library/yql/tests/sql/hybrid_file/part8/canondata/result.json
index 7b62299c7e..9fe417fa07 100644
--- a/ydb/library/yql/tests/sql/hybrid_file/part8/canondata/result.json
+++ b/ydb/library/yql/tests/sql/hybrid_file/part8/canondata/result.json
@@ -1343,6 +1343,20 @@
"uri": "https://{canondata_backend}/1923547/94f377eaa1d93890e1345ac4940cc6fa07bddd4f/resource.tar.gz#test.test_in-in_noansi-default.txt-Plan_/plan.txt"
}
],
+ "test.test[in-small_in_YQL-19183--Debug]": [
+ {
+ "checksum": "90279bdf10e6c5fe33509b2eaf53540c",
+ "size": 473,
+ "uri": "https://{canondata_backend}/1903885/f9d45bc250f07f42a2353007c7f2648896a84384/resource.tar.gz#test.test_in-small_in_YQL-19183--Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/f9d45bc250f07f42a2353007c7f2648896a84384/resource.tar.gz#test.test_in-small_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
"test.test[insert-append_missing_null-default.txt-Debug]": [
{
"checksum": "22d432d1951015310a3bbf0503113106",
diff --git a/ydb/library/yql/tests/sql/hybrid_file/part9/canondata/result.json b/ydb/library/yql/tests/sql/hybrid_file/part9/canondata/result.json
index 65dc458271..5899dd0dcb 100644
--- a/ydb/library/yql/tests/sql/hybrid_file/part9/canondata/result.json
+++ b/ydb/library/yql/tests/sql/hybrid_file/part9/canondata/result.json
@@ -1091,6 +1091,20 @@
"uri": "https://{canondata_backend}/1889210/796baf28896eb5aaad8828a0b6000e7d17563447/resource.tar.gz#test.test_in-in_with_nulls_and_optionals-default.txt-Plan_/plan.txt"
}
],
+ "test.test[in-large_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "e3ea538b42e9ed7b18bd731120e7fd16",
+ "size": 540,
+ "uri": "https://{canondata_backend}/1903885/4a384ef3fd6e8cf628d678d9322eef7d381022a7/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/4a384ef3fd6e8cf628d678d9322eef7d381022a7/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
"test.test[insert-append_after_replace-default.txt-Debug]": [
{
"checksum": "e053a922f685828f341eb8d8e7a948d4",
diff --git a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
index 666e15be4b..888c93c78a 100644
--- a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
+++ b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
@@ -7811,6 +7811,20 @@
"uri": "https://{canondata_backend}/1784117/d56ae82ad9d30397a41490647be1bd2124718f98/resource.tar.gz#test_sql2yql.test_in-in_with_tuple_simple_/sql.yql"
}
],
+ "test_sql2yql.test[in-large_in_YQL-19183]": [
+ {
+ "checksum": "1cd9f4cf26e7c5d827049443279a962a",
+ "size": 1235,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql2yql.test_in-large_in_YQL-19183_/sql.yql"
+ }
+ ],
+ "test_sql2yql.test[in-small_in_YQL-19183]": [
+ {
+ "checksum": "6e299275dd6fa3e68a43e108e0c6faad",
+ "size": 1074,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql2yql.test_in-small_in_YQL-19183_/sql.yql"
+ }
+ ],
"test_sql2yql.test[in-yql-10038]": [
{
"checksum": "42fe9dcb55e5dd5e0bc4ad7904bb270c",
@@ -27558,6 +27572,20 @@
"uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_in-in_with_tuple_simple_/formatted.sql"
}
],
+ "test_sql_format.test[in-large_in_YQL-19183]": [
+ {
+ "checksum": "43ec0a0e466a89676506fd531534cade",
+ "size": 181,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql_format.test_in-large_in_YQL-19183_/formatted.sql"
+ }
+ ],
+ "test_sql_format.test[in-small_in_YQL-19183]": [
+ {
+ "checksum": "c3241d35bbf2a2f6307a447c2994557e",
+ "size": 58,
+ "uri": "https://{canondata_backend}/1781765/eb7c60fb50105d611fff2bf104c60c98b06f3c01/resource.tar.gz#test_sql_format.test_in-small_in_YQL-19183_/formatted.sql"
+ }
+ ],
"test_sql_format.test[in-yql-10038]": [
{
"checksum": "65c9b60b81a2689c61b3dff1ff571b97",
diff --git a/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg
new file mode 100644
index 0000000000..1d3299a333
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183-ansi.cfg
@@ -0,0 +1 @@
+pragma AnsiInForEmptyOrNullableItemsCollections
diff --git a/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.cfg b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.cfg
new file mode 100644
index 0000000000..2ea925230e
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.cfg
@@ -0,0 +1 @@
+pragma warning("disable","1108")
diff --git a/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.sql b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.sql
new file mode 100644
index 0000000000..fb9209fee0
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/large_in_YQL-19183.sql
@@ -0,0 +1,10 @@
+$a = ('x',);
+$b1 = ('x','y1');
+$b2 = ('x','y2');
+$b3 = ('x','y3');
+$b4 = ('x','y4');
+$b5 = ('x','y5');
+$b6 = ('x','y6');
+
+SELECT $a in ($a, $b1, $b2, $b3, $b4, $b5, $b6)
+
diff --git a/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg
new file mode 100644
index 0000000000..1d3299a333
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183-ansi.cfg
@@ -0,0 +1 @@
+pragma AnsiInForEmptyOrNullableItemsCollections
diff --git a/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.cfg b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.cfg
new file mode 100644
index 0000000000..2ea925230e
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.cfg
@@ -0,0 +1 @@
+pragma warning("disable","1108")
diff --git a/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.sql b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.sql
new file mode 100644
index 0000000000..a351ad39bb
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/in/small_in_YQL-19183.sql
@@ -0,0 +1,5 @@
+$a = ('x',);
+$b = ('x','y');
+
+SELECT $a in ($a, $b);
+
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part13/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part13/canondata/result.json
index 5a5feb6d99..6497eaa24f 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part13/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part13/canondata/result.json
@@ -1052,6 +1052,27 @@
"uri": "https://{canondata_backend}/1937424/9bc2b8c2d88f8e65c3b04f141709ba87ca3b124c/resource.tar.gz#test.test_in-in_with_nulls_and_optionals_extra-default.txt-Results_/results.txt"
}
],
+ "test.test[in-large_in_YQL-19183--Debug]": [
+ {
+ "checksum": "f30ac9c644a8241629463a6904f8342c",
+ "size": 530,
+ "uri": "https://{canondata_backend}/1781765/be1dac32d2ff4e6b3360b484026fcb774e0eae51/resource.tar.gz#test.test_in-large_in_YQL-19183--Debug_/opt.yql"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1781765/be1dac32d2ff4e6b3360b484026fcb774e0eae51/resource.tar.gz#test.test_in-large_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183--Results]": [
+ {
+ "checksum": "b5fae5a6253aedc595c8dcbc9c51f8b3",
+ "size": 697,
+ "uri": "https://{canondata_backend}/1781765/be1dac32d2ff4e6b3360b484026fcb774e0eae51/resource.tar.gz#test.test_in-large_in_YQL-19183--Results_/results.txt"
+ }
+ ],
"test.test[insert-append_sorted-to_sorted-Debug]": [
{
"checksum": "5d65e5c83cee00d71367569494719e3a",
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part18/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part18/canondata/result.json
index 0b8527af2d..942fb845d0 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part18/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part18/canondata/result.json
@@ -1101,6 +1101,27 @@
"uri": "file://test.test_flatten_by-flatten_dict--Results_/extracted"
}
],
+ "test.test[in-small_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "e65a97321b8cfdd29a6e58e028163fd9",
+ "size": 353,
+ "uri": "https://{canondata_backend}/1781765/7492edde287c9f07ed8ec57c3c042a2c04f5f847/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Debug_/opt.yql"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1781765/7492edde287c9f07ed8ec57c3c042a2c04f5f847/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183-ansi-Results]": [
+ {
+ "checksum": "56de73c873cafff267843da0d2621330",
+ "size": 889,
+ "uri": "https://{canondata_backend}/1781765/7492edde287c9f07ed8ec57c3c042a2c04f5f847/resource.tar.gz#test.test_in-small_in_YQL-19183-ansi-Results_/results.txt"
+ }
+ ],
"test.test[insert-append_missing_null-default.txt-Debug]": [
{
"checksum": "3a1c14ac80f371e90ad5e78ba82759a1",
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part6/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part6/canondata/result.json
index 6dff567b03..4744959f04 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part6/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part6/canondata/result.json
@@ -1327,6 +1327,27 @@
"uri": "https://{canondata_backend}/1923547/9db3e11e4addc3a65ee82684bfbe078b6795a57a/resource.tar.gz#test.test_in-in_with_tuple-default.txt-Results_/results.txt"
}
],
+ "test.test[in-large_in_YQL-19183-ansi-Debug]": [
+ {
+ "checksum": "d2db64aa692293bef5a5592a7e62ff1b",
+ "size": 471,
+ "uri": "https://{canondata_backend}/1781765/5a7e27c5ee23d01d9d8c07e6282dd58a00acfdb2/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Debug_/opt.yql"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1781765/5a7e27c5ee23d01d9d8c07e6282dd58a00acfdb2/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-large_in_YQL-19183-ansi-Results]": [
+ {
+ "checksum": "56de73c873cafff267843da0d2621330",
+ "size": 889,
+ "uri": "https://{canondata_backend}/1781765/5a7e27c5ee23d01d9d8c07e6282dd58a00acfdb2/resource.tar.gz#test.test_in-large_in_YQL-19183-ansi-Results_/results.txt"
+ }
+ ],
"test.test[insert-after_group_by-default.txt-Debug]": [
{
"checksum": "693ee672e0d1cf914e5c5ce86169fa34",
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part9/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part9/canondata/result.json
index 51c9ea98c7..35554fd92a 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part9/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part9/canondata/result.json
@@ -1117,6 +1117,27 @@
"uri": "https://{canondata_backend}/1775059/d0c85f9ec0b8e84cf0b352e7062a1381f04420c8/resource.tar.gz#test.test_in-in_immediate_subquery-default.txt-Results_/results.txt"
}
],
+ "test.test[in-small_in_YQL-19183--Debug]": [
+ {
+ "checksum": "d655665a4049832e8248cb28c28ce57b",
+ "size": 412,
+ "uri": "https://{canondata_backend}/1903885/39547a9cfff0ae3bdd8ae3ccfafd977ab412b927/resource.tar.gz#test.test_in-small_in_YQL-19183--Debug_/opt.yql"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Plan]": [
+ {
+ "checksum": "b4dd508a329723c74293d80f0278c705",
+ "size": 505,
+ "uri": "https://{canondata_backend}/1903885/39547a9cfff0ae3bdd8ae3ccfafd977ab412b927/resource.tar.gz#test.test_in-small_in_YQL-19183--Plan_/plan.txt"
+ }
+ ],
+ "test.test[in-small_in_YQL-19183--Results]": [
+ {
+ "checksum": "b5fae5a6253aedc595c8dcbc9c51f8b3",
+ "size": 697,
+ "uri": "https://{canondata_backend}/1903885/39547a9cfff0ae3bdd8ae3ccfafd977ab412b927/resource.tar.gz#test.test_in-small_in_YQL-19183--Results_/results.txt"
+ }
+ ],
"test.test[insert-keepmeta-view_fail-Debug]": [],
"test.test[insert-keepmeta-view_fail-Plan]": [],
"test.test[insert-keepmeta-view_fail-Results]": [