summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/sbe/stages/column_scan.h
diff options
context:
space:
mode:
authorIan Boros <ian.boros@mongodb.com>2022-04-27 11:01:18 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-28 16:01:18 +0000
commitcadaba712c0f063816faa766098725da73ad073e (patch)
tree129440f94e785a26b0d0b077e99d0ada8ae72962 /src/mongo/db/exec/sbe/stages/column_scan.h
parentd40ef71d68e67e4b55ffc8c1274a38ed4ead1f97 (diff)
downloadmongo-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.h36
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;