aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorns-vasilev <ns-vasilev@yandex-team.com>2023-11-08 14:36:20 +0300
committerns-vasilev <ns-vasilev@yandex-team.com>2023-11-08 15:33:18 +0300
commit5ac12f81dc622d31014cc413643c304734acbafa (patch)
tree92859f44f057bcd1555c4b41d5eaa1b633f42b05
parentaf229b53e4c4a23e0e78f0d863001109089b7464 (diff)
downloadydb-5ac12f81dc622d31014cc413643c304734acbafa.tar.gz
KIKIMR-19702: fixes for generic olap
Блочное чтение заработало плохо, его сюда не включал.
-rw-r--r--ydb/core/kqp/executer_actor/kqp_planner.cpp4
-rw-r--r--ydb/core/kqp/opt/logical/kqp_opt_log_join.cpp3
-rw-r--r--ydb/core/kqp/opt/logical/kqp_opt_log_ranges.cpp6
-rw-r--r--ydb/core/kqp/opt/physical/kqp_opt_phy_limit.cpp4
-rw-r--r--ydb/core/kqp/session_actor/kqp_worker_actor.cpp1
5 files changed, 8 insertions, 10 deletions
diff --git a/ydb/core/kqp/executer_actor/kqp_planner.cpp b/ydb/core/kqp/executer_actor/kqp_planner.cpp
index d24dc7fefd..691258583f 100644
--- a/ydb/core/kqp/executer_actor/kqp_planner.cpp
+++ b/ydb/core/kqp/executer_actor/kqp_planner.cpp
@@ -330,8 +330,8 @@ void TKqpPlanner::ExecuteDataComputeTask(ui64 taskId, bool shareMailbox, bool op
if (Deadline) {
settings.Timeout = Deadline - TAppData::TimeProvider->Now();
}
- //settings.ExtraMemoryAllocationPool = NRm::EKqpMemoryPool::DataQuery;
- settings.ExtraMemoryAllocationPool = NRm::EKqpMemoryPool::Unspecified;
+
+ settings.ExtraMemoryAllocationPool = NRm::EKqpMemoryPool::DataQuery;
settings.FailOnUndelivery = true;
settings.StatsMode = GetDqStatsMode(StatsMode);
settings.UseSpilling = false;
diff --git a/ydb/core/kqp/opt/logical/kqp_opt_log_join.cpp b/ydb/core/kqp/opt/logical/kqp_opt_log_join.cpp
index 293289ee36..59141ae666 100644
--- a/ydb/core/kqp/opt/logical/kqp_opt_log_join.cpp
+++ b/ydb/core/kqp/opt/logical/kqp_opt_log_join.cpp
@@ -462,6 +462,9 @@ TMaybeNode<TExprBase> KqpJoinToIndexLookupImpl(const TDqJoin& join, TExprContext
Y_ENSURE(rightTableKeyPrefix);
const auto& rightTableDesc = kqpCtx.Tables->ExistingTable(kqpCtx.Cluster, lookupTable);
+ if (rightTableDesc.Metadata->Kind == NYql::EKikimrTableKind::Olap) {
+ return {};
+ }
TMap<std::string_view, TString> rightJoinKeyToLeft;
TVector<TCoAtom> rightKeyColumns;
diff --git a/ydb/core/kqp/opt/logical/kqp_opt_log_ranges.cpp b/ydb/core/kqp/opt/logical/kqp_opt_log_ranges.cpp
index 62421840e0..2116a280eb 100644
--- a/ydb/core/kqp/opt/logical/kqp_opt_log_ranges.cpp
+++ b/ydb/core/kqp/opt/logical/kqp_opt_log_ranges.cpp
@@ -222,7 +222,7 @@ TExprBase KqpPushPredicateToReadTable(TExprBase node, TExprContext& ctx, const T
fetches.reserve(lookup.GetKeyRanges().size());
for (auto& keyRange : lookup.GetKeyRanges()) {
- bool useDataQueryLookup = false;
+ bool useDataOrGenericQueryLookup = false;
bool useScanQueryLookup = false;
if (onlyPointRanges && !IsPointPrefix(keyRange)) {
return node;
@@ -233,13 +233,13 @@ TExprBase KqpPushPredicateToReadTable(TExprBase node, TExprContext& ctx, const T
// NOTE: Use more efficient full key lookup implementation in datashard.
// Consider using lookup for partial keys as well once better constant folding
// is available, currently it can introduce redundant compute stage.
- useDataQueryLookup = kqpCtx.IsDataQuery() && isFullKey;
+ useDataOrGenericQueryLookup = (kqpCtx.IsDataQuery() || kqpCtx.IsGenericQuery()) && isFullKey;
useScanQueryLookup = kqpCtx.IsScanQuery() && isFullKey
&& kqpCtx.Config->EnableKqpScanQueryStreamLookup;
}
TMaybeNode<TExprBase> readInput;
- if (useDataQueryLookup) {
+ if (useDataOrGenericQueryLookup) {
auto lookupKeys = BuildEquiRangeLookup(keyRange, tableDesc, read.Pos(), ctx);
if (indexName) {
diff --git a/ydb/core/kqp/opt/physical/kqp_opt_phy_limit.cpp b/ydb/core/kqp/opt/physical/kqp_opt_phy_limit.cpp
index 1509730963..f053826c63 100644
--- a/ydb/core/kqp/opt/physical/kqp_opt_phy_limit.cpp
+++ b/ydb/core/kqp/opt/physical/kqp_opt_phy_limit.cpp
@@ -112,10 +112,6 @@ TExprBase KqpApplyLimitToOlapReadTable(TExprBase node, TExprContext& ctx, const
return node;
}
- if (!kqpCtx.IsScanQuery()) {
- return node;
- }
-
const bool isReadTableRanges = true;
auto& tableDesc = kqpCtx.Tables->ExistingTable(kqpCtx.Cluster, GetReadTablePath(input, isReadTableRanges));
diff --git a/ydb/core/kqp/session_actor/kqp_worker_actor.cpp b/ydb/core/kqp/session_actor/kqp_worker_actor.cpp
index d113737683..e1c274e5b0 100644
--- a/ydb/core/kqp/session_actor/kqp_worker_actor.cpp
+++ b/ydb/core/kqp/session_actor/kqp_worker_actor.cpp
@@ -641,7 +641,6 @@ private:
case NKikimrKqp::QUERY_TYPE_SQL_DML:
case NKikimrKqp::QUERY_TYPE_AST_DML: {
bool isSql = (type == NKikimrKqp::QUERY_TYPE_SQL_DML);
-
QueryState->AsyncQueryResult = KqpHost->ExplainDataQuery(query, isSql);
break;
}