Skip to content

Commit

Permalink
fetch additional fields in special corner case (ydb-platform#2116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Feb 21, 2024
1 parent 9683aeb commit a950903
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ class TColumnsSet {
return true;
}

bool Cross(const TColumnsSet& columnsSet) const {
for (auto&& i : columnsSet.ColumnIds) {
if (ColumnIds.contains(i)) {
return true;
}
}
return false;
}

bool IsEqual(const TColumnsSet& columnsSet) const {
if (columnsSet.GetColumnIds().size() != ColumnIds.size()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::shared_ptr<NKikimr::NOlap::NPlainReader::IFetchingStep> TSpecialReadContext
}
} else if (exclusiveSource) {
TColumnsSet columnsFetch = *EFColumns;
if (needSnapshots || FFColumns->Contains(SpecColumns)) {
if (needSnapshots || FFColumns->Cross(*SpecColumns)) {
columnsFetch = columnsFetch + *SpecColumns;
}
if (partialUsageByPredicate) {
Expand All @@ -60,7 +60,7 @@ std::shared_ptr<NKikimr::NOlap::NPlainReader::IFetchingStep> TSpecialReadContext
AFL_VERIFY(columnsFetch.GetColumnsCount());
current = current->AttachNext(std::make_shared<TBlobsFetchingStep>(std::make_shared<TColumnsSet>(columnsFetch), "ef"));

if (needSnapshots || FFColumns->Contains(SpecColumns)) {
if (needSnapshots || FFColumns->Cross(*SpecColumns)) {
current = current->AttachNext(std::make_shared<TAssemblerStep>(SpecColumns));
current = current->AttachNext(std::make_shared<TSnapshotFilter>());
columnsFetch = columnsFetch - *SpecColumns;
Expand Down
3 changes: 0 additions & 3 deletions ydb/core/tx/columnshard/engines/reader/plain_reader/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class TSpecialReadContext {
NIndexes::TIndexCheckerContainer IndexChecker;
TReadMetadata::TConstPtr ReadMetadata;
std::shared_ptr<TColumnsSet> EmptyColumns = std::make_shared<TColumnsSet>();
std::shared_ptr<TColumnsSet> PKFFColumns;
std::shared_ptr<TColumnsSet> EFPKColumns;
std::shared_ptr<TColumnsSet> FFMinusEFColumns;
std::shared_ptr<IFetchingStep> BuildColumnsFetchingPlan(const bool needSnapshotsFilter, const bool exclusiveSource, const bool partialUsageByPredicate) const;
std::array<std::array<std::array<std::shared_ptr<IFetchingStep>, 2>, 2>, 2> CacheFetchingScripts;
public:
Expand Down

0 comments on commit a950903

Please sign in to comment.