diff options
author | Ian Boros <ian.boros@mongodb.com> | 2022-04-27 11:01:18 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-28 16:01:18 +0000 |
commit | cadaba712c0f063816faa766098725da73ad073e (patch) | |
tree | 129440f94e785a26b0d0b077e99d0ada8ae72962 /src/mongo/db/exec/sbe/stages/column_scan.h | |
parent | d40ef71d68e67e4b55ffc8c1274a38ed4ead1f97 (diff) | |
download | mongo-cadaba712c0f063816faa766098725da73ad073e.tar.gz |
SERVER-66022 Add fake column index and SBE integration
Diffstat (limited to 'src/mongo/db/exec/sbe/stages/column_scan.h')
-rw-r--r-- | src/mongo/db/exec/sbe/stages/column_scan.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/mongo/db/exec/sbe/stages/column_scan.h b/src/mongo/db/exec/sbe/stages/column_scan.h index 22ca42ee401..e555d10a114 100644 --- a/src/mongo/db/exec/sbe/stages/column_scan.h +++ b/src/mongo/db/exec/sbe/stages/column_scan.h @@ -30,6 +30,7 @@ #pragma once #include "mongo/config.h" +#include "mongo/db/exec/fake_column_cursor.h" #include "mongo/db/exec/sbe/expressions/expression.h" #include "mongo/db/exec/sbe/stages/collection_helpers.h" #include "mongo/db/exec/sbe/stages/stages.h" @@ -77,6 +78,36 @@ protected: TrialRunTracker* tracker, TrialRunTrackerAttachResultMask childrenAttachResult) override; private: + struct ColumnCursor { + std::unique_ptr<FakeCursorForPath> cursor; + boost::optional<FakeCell> lastCell; + bool includeInOutput = false; + + boost::optional<FakeCell>& next() { + // TODO For some reason the destructor of 'lastCell' is not called + // on my local asan build unless we explicitly reset it. Maybe + // the same compiler bug Nikita ran into? + lastCell.reset(); + lastCell = cursor->next(); + return lastCell; + } + + boost::optional<FakeCell>& seekAtOrPast(RecordId id) { + lastCell.reset(); + lastCell = cursor->seekAtOrPast(id); + return lastCell; + } + + const PathValue& path() const { + return cursor->path(); + } + }; + + void readParentsIntoObj(StringData path, + value::Object* out, + StringDataSet* pathsReadSetOut, + bool first = true); + const UUID _collUuid; const std::string _columnIndexName; const value::SlotVector _fieldSlots; @@ -109,7 +140,10 @@ private: CollectionPtr _coll; - std::unique_ptr<SeekableRecordCursor> _cursor; + std::unique_ptr<SeekableRecordCursor> _rowStoreCursor; + + std::vector<ColumnCursor> _columnCursors; + StringMap<std::unique_ptr<FakeCursorForPath>> _parentPathCursors; RecordId _recordId; |