Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nepal authored Nov 2, 2024
1 parent 97f15da commit a445d97
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::BypassMerge(TExprBase n
for (auto path: section.Paths()) {
updatedPaths.push_back(path);

bool hasRanges = false;
if (!path.Ranges().Maybe<TCoVoid>()) {
bool pathLimits = false;
for (auto range: path.Ranges().Cast<TExprList>()) {
if (range.Maybe<TYtRow>() || range.Maybe<TYtRowRange>()) {
pathLimits = true;
break;
}
if (range.Maybe<TYtRangeItemBase>()) {
hasRanges = true;
}
}
if (pathLimits) {
continue;
Expand Down Expand Up @@ -118,7 +122,7 @@ TMaybeNode<TExprBase> TYtPhysicalOptProposalTransformer::BypassMerge(TExprBase n
if (hasTakeSkip && sortedMerge && NYql::HasSetting(innerMerge.Settings().Ref(), EYtSettingType::KeepSorted)) {
continue;
}
if (hasTakeSkip && AnyOf(innerMergeSection.Paths(), [](const auto& path) { return !path.Ranges().template Maybe<TCoVoid>(); })) {
if ((hasTakeSkip || hasRanges) && AnyOf(innerMergeSection.Paths(), [](const auto& path) { return !path.Ranges().template Maybe<TCoVoid>(); })) {
continue;
}

Expand Down
14 changes: 14 additions & 0 deletions ydb/library/yql/tests/sql/sql2yql/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -10142,6 +10142,13 @@
"uri": "https://{canondata_backend}/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_key_filter-nile_pred_/sql.yql"
}
],
"test_sql2yql.test[key_filter-no_bypass_merge]": [
{
"checksum": "8f1e1bfb745fc93ab99799dd4bee37d2",
"size": 3234,
"uri": "https://{canondata_backend}/937458/29a3c1b9b216969a2d55da5642f70db3cb889590/resource.tar.gz#test_sql2yql.test_key_filter-no_bypass_merge_/sql.yql"
}
],
"test_sql2yql.test[key_filter-part_key_over_dynamic]": [
{
"checksum": "ed0c681c0b57fd43338fa44f79dfcda3",
Expand Down Expand Up @@ -29693,6 +29700,13 @@
"uri": "https://{canondata_backend}/1880306/64654158d6bfb1289c66c626a8162239289559d0/resource.tar.gz#test_sql_format.test_key_filter-nile_pred_/formatted.sql"
}
],
"test_sql_format.test[key_filter-no_bypass_merge]": [
{
"checksum": "c11c4aac4740bc96f1f16fc34273b3b5",
"size": 338,
"uri": "https://{canondata_backend}/1946324/60ea49a653935bd647f75184f5571f43eaea2f1e/resource.tar.gz#test_sql_format.test_key_filter-no_bypass_merge_/formatted.sql"
}
],
"test_sql_format.test[key_filter-part_key_over_dynamic]": [
{
"checksum": "d0780baa61449d404c28577d330972b1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
in Input sorted2.txt
res result.txt
providers yt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* ignore runonopt plan diff - extra LogicalOptimizer-PushdownOpColumns */
pragma yt.PruneKeyFilterLambda = 'true';

USE plato;

$src = select * from Input where key == "1" || "5" || "0";
select key, subkey from $src;
select key, value from $src where key >= "000" and key < "999" and len(value) > 0;
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,27 @@
"uri": "https://{canondata_backend}/1942415/9dc26178536314feaac77333a6a0e27c8703d1e2/resource.tar.gz#test.test_key_filter-multiusage--Results_/results.txt"
}
],
"test.test[key_filter-no_bypass_merge--Debug]": [
{
"checksum": "9efb0ce10102840559dccf5f29a12682",
"size": 2615,
"uri": "https://{canondata_backend}/1920236/8c593c8466092b61944efd67353210491ded1ec3/resource.tar.gz#test.test_key_filter-no_bypass_merge--Debug_/opt.yql"
}
],
"test.test[key_filter-no_bypass_merge--Plan]": [
{
"checksum": "00bc4300b735e6c0e3643be6c50db81d",
"size": 7695,
"uri": "https://{canondata_backend}/1920236/8c593c8466092b61944efd67353210491ded1ec3/resource.tar.gz#test.test_key_filter-no_bypass_merge--Plan_/plan.txt"
}
],
"test.test[key_filter-no_bypass_merge--Results]": [
{
"checksum": "d0d822f1bcf2596880c7df78329d0916",
"size": 2393,
"uri": "https://{canondata_backend}/1920236/8c593c8466092b61944efd67353210491ded1ec3/resource.tar.gz#test.test_key_filter-no_bypass_merge--Results_/results.txt"
}
],
"test.test[key_filter-string_with_legacy--Debug]": [
{
"checksum": "c4cc2c1f00131d237cc8e804250ef355",
Expand Down

0 comments on commit a445d97

Please sign in to comment.