Skip to content

Commit

Permalink
Fix olap reads in data query (#12463)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvas0 authored Dec 10, 2024
1 parent 239068a commit 80aedb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ydb/core/kqp/executer_actor/kqp_data_executer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
default:
YQL_ENSURE(false, "unknown source type");
}
} else if (StreamResult && stageInfo.Meta.IsOlap() && stage.SinksSize() == 0) {
} else if ((AllowOlapDataQuery || StreamResult) && stageInfo.Meta.IsOlap() && stage.SinksSize() == 0) {
BuildScanTasksFromShards(stageInfo);
} else if (stageInfo.Meta.IsSysView()) {
BuildSysViewScanTasks(stageInfo);
Expand Down Expand Up @@ -2161,7 +2161,7 @@ class TKqpDataExecuter : public TKqpExecuterBase<TKqpDataExecuter, EExecType::Da
void HandleResolve(TEvKqpExecuter::TEvTableResolveStatus::TPtr& ev) {
if (!TBase::HandleResolve(ev)) return;

if (StreamResult) {
if (StreamResult || AllowOlapDataQuery) {
TSet<ui64> shardIds;
for (auto& [stageId, stageInfo] : TasksGraph.GetStagesInfo()) {
if (stageInfo.Meta.IsOlap()) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/kqp/ut/olap/kqp_olap_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,10 +1867,10 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
ORDER BY CounterID, WatchID
)";

auto it = tableClient.StreamExecuteScanQuery(query).GetValueSync();
auto it = session.ExecuteDataQuery(query, TTxControl::BeginTx(TTxSettings::SerializableRW()).CommitTx()).GetValueSync();

UNIT_ASSERT_C(it.IsSuccess(), it.GetIssues().ToString());
TString result = StreamResultToYson(it);
TString result = FormatResultSetYson(it.GetResultSet(0));
Cout << result << Endl;
CompareYson(result, R"([[15;0];[15;1]])");
}
Expand Down

0 comments on commit 80aedb4

Please sign in to comment.