diff options
author | Justin Zhang <justin.zhang@mongodb.com> | 2022-07-29 23:24:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-30 00:27:09 +0000 |
commit | 123eda7b00d3ed74e3b15c351ae029e720a8b80c (patch) | |
tree | 50cb29175ec0f3a16f344e98fb3cac241af6d247 /src/mongo/db/index/column_key_generator.h | |
parent | a2a8ab39110826d70081ee680f34bb9d342d24d5 (diff) | |
download | mongo-123eda7b00d3ed74e3b15c351ae029e720a8b80c.tar.gz |
SERVER-63123 Add support for creating columnar indexes with a subset of fields via projection
Diffstat (limited to 'src/mongo/db/index/column_key_generator.h')
-rw-r--r-- | src/mongo/db/index/column_key_generator.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mongo/db/index/column_key_generator.h b/src/mongo/db/index/column_key_generator.h index 5fa06031bd4..b9f02eadecd 100644 --- a/src/mongo/db/index/column_key_generator.h +++ b/src/mongo/db/index/column_key_generator.h @@ -32,9 +32,36 @@ #include <iosfwd> #include "mongo/db/catalog/index_catalog.h" +#include "mongo/db/exec/index_path_projection.h" +#include "mongo/db/exec/projection_executor.h" +#include "mongo/db/exec/projection_executor_builder.h" +#include "mongo/db/query/projection_parser.h" #include "mongo/db/storage/column_store.h" #include "mongo/util/functional.h" +namespace mongo { +class ColumnKeyGenerator { +public: + static constexpr StringData kSubtreeSuffix = ".$**"_sd; + + ColumnKeyGenerator(BSONObj keyPattern, BSONObj pathProjection); + + static ColumnStoreProjection createProjectionExecutor(BSONObj keyPattern, + BSONObj pathProjection); + + /** + * Returns a pointer to the key generator's underlying ProjectionExecutor. + */ + const ColumnStoreProjection* getColumnstoreProjection() const { + return &_proj; + } + +private: + ColumnStoreProjection _proj; + const BSONObj _keyPattern; +}; +} // namespace mongo + namespace mongo::column_keygen { /** * This is a representation of the cell prior to flattening it out into a buffer which is passed to |