Skip to content

Fix predicate pushdown prompt #2348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/kqp/opt/logical/kqp_opt_log_ranges_predext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ TExprBase KqpPushExtractedPredicateToReadTable(TExprBase node, TExprContext& ctx
if (buildResult.ExpectedMaxRanges.Defined()) {
prompt.SetExpectedMaxRanges(buildResult.ExpectedMaxRanges.GetRef());
}
prompt.SetPointPrefixLen(buildResult.UsedPrefixLen);
prompt.SetPointPrefixLen(buildResult.PointPrefixLen);

YQL_CLOG(DEBUG, ProviderKqp) << "Ranges extracted: " << KqpExprToPrettyString(*ranges, ctx);
YQL_CLOG(DEBUG, ProviderKqp) << "Residual lambda: " << KqpExprToPrettyString(*residualLambda, ctx);
Expand Down
16 changes: 16 additions & 0 deletions ydb/core/kqp/ut/opt/kqp_ne_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2640,6 +2640,22 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
])", FormatResultSetYson(result.GetResultSet(0)));
}

Y_UNIT_TEST(DeleteON) {
auto kikimr = DefaultKikimrRunner();
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

NYdb::NTable::TExecDataQuerySettings execSettings;
execSettings.CollectQueryStats(ECollectQueryStatsMode::Basic);

auto result = session.ExecuteDataQuery(R"(
--!syntax_v1

DELETE FROM `/Root/Join2` where (Key1 = 1 and Key2 = "") OR Key1 = 3;
)", TTxControl::BeginTx().CommitTx(), execSettings).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
}

Y_UNIT_TEST(JoinWithPrecompute) {
auto kikimr = DefaultKikimrRunner();
auto db = kikimr.GetTableClient();
Expand Down