aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov333 <ivanmorozov@ydb.tech>2024-12-20 00:29:28 +0300
committerGitHub <noreply@github.com>2024-12-19 21:29:28 +0000
commita39dc2ad6fb95ab2544d0736c8b4f9ac4f1060d6 (patch)
treec2ad7d02e43a948ed583e0e97d4e1a7ad6885aca
parent737b0d53d59148bab5b20c686e9668c814cbfd3e (diff)
downloadydb-a39dc2ad6fb95ab2544d0736c8b4f9ac4f1060d6.tar.gz
switchable slices filter (#12791)
-rw-r--r--ydb/core/protos/config.proto1
-rw-r--r--ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h10
2 files changed, 8 insertions, 3 deletions
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index 35ecd803d6..79ca260fef 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -1737,6 +1737,7 @@ message TColumnShardConfig {
optional string ReaderClassName = 28;
optional bool AllowNullableColumnsInPK = 29 [default = false];
optional uint32 RestoreDataOnWriteTimeoutSeconds = 30;
+ optional bool UseSlicesFilter = 31 [default = true];
}
message TSchemeShardConfig {
diff --git a/ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h b/ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h
index 00a5d5b4d1..421b612ec7 100644
--- a/ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h
+++ b/ydb/core/tx/columnshard/engines/reader/common_reader/iterator/fetched_data.h
@@ -1,7 +1,9 @@
#pragma once
+#include <ydb/core/base/appdata.h>
#include <ydb/core/formats/arrow/arrow_filter.h>
#include <ydb/core/formats/arrow/common/container.h>
#include <ydb/core/formats/arrow/size_calcer.h>
+#include <ydb/core/protos/config.pb.h>
#include <ydb/core/tx/columnshard/blob.h>
#include <ydb/core/tx/columnshard/blobs_reader/task.h>
#include <ydb/core/tx/columnshard/engines/portions/data_accessor.h>
@@ -146,7 +148,8 @@ public:
void AddFilter(const NArrow::TColumnFilter& filter) {
if (UseFilter && Table) {
- AFL_VERIFY(filter.Apply(Table, NArrow::TColumnFilter::TApplyContext().SetTrySlices(true)));
+ AFL_VERIFY(filter.Apply(Table,
+ NArrow::TColumnFilter::TApplyContext().SetTrySlices(!HasAppData() || AppDataVerified().ColumnShardConfig.GetUseSlicesFilter())));
}
if (!Filter) {
Filter = std::make_shared<NArrow::TColumnFilter>(filter);
@@ -176,7 +179,8 @@ public:
DataAdded = true;
auto tableLocal = table;
if (Filter && UseFilter) {
- AFL_VERIFY(Filter->Apply(tableLocal, NArrow::TColumnFilter::TApplyContext().SetTrySlices(true)));
+ AFL_VERIFY(Filter->Apply(tableLocal,
+ NArrow::TColumnFilter::TApplyContext().SetTrySlices(!HasAppData() || AppDataVerified().ColumnShardConfig.GetUseSlicesFilter())));
}
if (!Table) {
Table = std::make_shared<NArrow::TGeneralContainer>(tableLocal);
@@ -246,4 +250,4 @@ public:
}
};
-} // namespace NKikimr::NOlap
+} // namespace NKikimr::NOlap::NReader::NCommon