aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchertus <azuikov@ydb.tech>2023-03-27 21:20:42 +0300
committerchertus <azuikov@ydb.tech>2023-03-27 21:20:42 +0300
commitbab43382d26a6362af1dc15721fe52d473a9b750 (patch)
tree07cbb16da8668fa9a886cbf36dce3f645360c56a
parentf860a9ef931567eca872c633fa67bd1aeec464a7 (diff)
downloadydb-bab43382d26a6362af1dc15721fe52d473a9b750.tar.gz
fix missinformation in SelectInfo portions
-rw-r--r--ydb/core/tx/columnshard/engines/column_engine_logs.cpp2
-rw-r--r--ydb/core/tx/columnshard/engines/indexed_read_data.cpp3
-rw-r--r--ydb/core/tx/columnshard/engines/portion_info.h3
3 files changed, 6 insertions, 2 deletions
diff --git a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
index 2828cbb078..d08cb1d695 100644
--- a/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
+++ b/ydb/core/tx/columnshard/engines/column_engine_logs.cpp
@@ -1461,6 +1461,7 @@ std::shared_ptr<TSelectInfo> TColumnEngineForLogs::Select(ui64 pathId, TSnapshot
auto& portionInfo = portions.find(portion)->second;
TPortionInfo outPortion;
+ outPortion.Meta = portionInfo.Meta;
outPortion.Records.reserve(columnIds.size());
for (auto& rec : portionInfo.Records) {
@@ -1469,6 +1470,7 @@ std::shared_ptr<TSelectInfo> TColumnEngineForLogs::Select(ui64 pathId, TSnapshot
outPortion.Records.push_back(rec);
}
}
+ Y_VERIFY(outPortion.Produced());
out->Portions.emplace_back(std::move(outPortion));
granuleHasDataForSnaphsot = true;
}
diff --git a/ydb/core/tx/columnshard/engines/indexed_read_data.cpp b/ydb/core/tx/columnshard/engines/indexed_read_data.cpp
index 993379169f..4466b546a7 100644
--- a/ydb/core/tx/columnshard/engines/indexed_read_data.cpp
+++ b/ydb/core/tx/columnshard/engines/indexed_read_data.cpp
@@ -240,6 +240,7 @@ void TIndexedReadData::AddIndexed(const TBlobRange& blobRange, const TString& co
std::shared_ptr<arrow::RecordBatch> TIndexedReadData::AssembleIndexedBatch(ui32 batchNo) {
auto& portionInfo = Portion(batchNo);
+ Y_VERIFY(portionInfo.Produced());
auto batch = portionInfo.AssembleInBatch(ReadMetadata->IndexInfo, ReadMetadata->LoadSchema, Data);
Y_VERIFY(batch);
@@ -258,7 +259,7 @@ std::shared_ptr<arrow::RecordBatch> TIndexedReadData::AssembleIndexedBatch(ui32
filtered.ApplyFilter();
}
#if 1 // optimization
- if (ReadMetadata->Program && portionInfo.AllowEarlyFilter()) {
+ if (filtered.Batch && ReadMetadata->Program && portionInfo.AllowEarlyFilter()) {
filtered = NOlap::EarlyFilter(filtered.Batch, ReadMetadata->Program);
}
if (filtered.Batch) {
diff --git a/ydb/core/tx/columnshard/engines/portion_info.h b/ydb/core/tx/columnshard/engines/portion_info.h
index 0c9123a454..5a1af22138 100644
--- a/ydb/core/tx/columnshard/engines/portion_info.h
+++ b/ydb/core/tx/columnshard/engines/portion_info.h
@@ -51,7 +51,8 @@ struct TPortionInfo {
TString TierName;
bool Empty() const { return Records.empty(); }
- bool Valid() const { return !Empty() && Meta.Produced != TPortionMeta::UNSPECIFIED && HasMinMax(FirstPkColumn); }
+ bool Produced() const { return Meta.Produced != TPortionMeta::UNSPECIFIED; }
+ bool Valid() const { return !Empty() && Produced() && HasMinMax(FirstPkColumn); }
bool IsInserted() const { return Meta.Produced == TPortionMeta::INSERTED; }
bool CanHaveDups() const { return !Valid(); /* || IsInserted(); */ }
bool CanIntersectOthers() const { return !Valid() || IsInserted(); }