Skip to content

Commit a39dc2a

Browse files
switchable slices filter (#12791)
1 parent 737b0d5 commit a39dc2a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ydb/core/protos/config.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ message TColumnShardConfig {
17371737
optional string ReaderClassName = 28;
17381738
optional bool AllowNullableColumnsInPK = 29 [default = false];
17391739
optional uint32 RestoreDataOnWriteTimeoutSeconds = 30;
1740+
optional bool UseSlicesFilter = 31 [default = true];
17401741
}
17411742

17421743
message TSchemeShardConfig {

ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
2+
#include <ydb/core/base/appdata.h>
23
#include <ydb/core/formats/arrow/arrow_filter.h>
34
#include <ydb/core/formats/arrow/common/container.h>
45
#include <ydb/core/formats/arrow/size_calcer.h>
6+
#include <ydb/core/protos/config.pb.h>
57
#include <ydb/core/tx/columnshard/blob.h>
68
#include <ydb/core/tx/columnshard/blobs_reader/task.h>
79
#include <ydb/core/tx/columnshard/engines/portions/data_accessor.h>
@@ -146,7 +148,8 @@ class TFetchedData {
146148

147149
void AddFilter(const NArrow::TColumnFilter& filter) {
148150
if (UseFilter && Table) {
149-
AFL_VERIFY(filter.Apply(Table, NArrow::TColumnFilter::TApplyContext().SetTrySlices(true)));
151+
AFL_VERIFY(filter.Apply(Table,
152+
NArrow::TColumnFilter::TApplyContext().SetTrySlices(!HasAppData() || AppDataVerified().ColumnShardConfig.GetUseSlicesFilter())));
150153
}
151154
if (!Filter) {
152155
Filter = std::make_shared<NArrow::TColumnFilter>(filter);
@@ -176,7 +179,8 @@ class TFetchedData {
176179
DataAdded = true;
177180
auto tableLocal = table;
178181
if (Filter && UseFilter) {
179-
AFL_VERIFY(Filter->Apply(tableLocal, NArrow::TColumnFilter::TApplyContext().SetTrySlices(true)));
182+
AFL_VERIFY(Filter->Apply(tableLocal,
183+
NArrow::TColumnFilter::TApplyContext().SetTrySlices(!HasAppData() || AppDataVerified().ColumnShardConfig.GetUseSlicesFilter())));
180184
}
181185
if (!Table) {
182186
Table = std::make_shared<NArrow::TGeneralContainer>(tableLocal);
@@ -246,4 +250,4 @@ class TFetchedResult {
246250
}
247251
};
248252

249-
} // namespace NKikimr::NOlap
253+
} // namespace NKikimr::NOlap::NReader::NCommon

0 commit comments

Comments
 (0)