-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Modify LiteParsedPipeline to loop over all LPDS stages, apply callbacks, enforce disallow rules, and prepend the view pipeline when no custom behavior is present.
The following functions should be added to LiteParsedPipeline:
class LiteParsedPipeline { public: void handleView(const ViewInfo& viewInfo) { auto aggregatePolicy = DefaultViewPolicy; for (const auto& stage : _stageSpecs) { auto thisPolicy = stage->getViewPolicy(); std::visit( OverloadedVisitor{ [&](LiteParsedDocumentSource::DefaultViewPolicy) { aggregatePolicy = std::max(aggregatePolicy, thisPolicy); }, [&]LiteParsedDocumentSource::ViewPolicyFn& fn) { fn(viewInfo); aggregatePolicy = std::max(aggregatePolicy, thisPolicy); }, [&]LiteParsedDocumentSource::DisallowViewType& errorMsg) { uasserted(ErrorCodes::CommandNotSupportedOnView, str::stream() << "Stage " << _parseTimeName << errorMsg // " is disallowed on views"); }, thisPolicy); } if (aggregatePolicy == DefaultViewPolicy) { prependViewPipeline(viewInfo); } } void prependViewPipeline(const ViewInfo& viewInfo) { LiteParsedVec newStages; newStages.reserve(viewInfo.viewPipe.size() + _stageSpecs.size()); // Copy/move the view's effective pipeline first. for (auto& viewStage : viewInfo.viewPipe) { newStages.push_back(std::move(viewStage)); } // Append the existing user pipeline. for (auto& stage : _stageSpecs) { newStages.push_back(std::move(stage)); } _stageSpecs = std::move(newStages); } private: LiteParsedVec _stageSpecs; }
- depends on
-
SERVER-115078 Move desugaring before view application
-
- In Progress
-
-
SERVER-115057 Add getViewPolicy() to LiteParsedDocumentSource
-
- Needs Scheduling
-
- is depended on by
-
SERVER-115082 Integrate new ViewPolicy into runAggregate()
-
- Needs Scheduling
-
- is duplicated by
-
SERVER-115058 Add view handling driver to runAggregate()
-
- Closed
-