Implement MongoExtensionDPLArray (variant array <LogicalStage,ParseNode>)

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In order to avoid going through a full serialize/parse cycle for a LogicalStage during distributed planning, we'd like MongoExtensionDistributedPlanLogic to be able to return an array of variants, where the variant can be either a LogicalStage or a ParseNode.

      • struct MongoExtensionDPLArray {
            size_t size;    
            struct MongoExtensionDPLArrayElement* const elements;
        };
        
        /** * Types of nodes which can be in an MongoExtensionDPLArray */
        typedef enum MongoExtensionDPLArrayElementType : uint32_t {    
            kParseNode = 0,    
            kLogicalStage = 1} 
        
        MongoExtensionDPLArrayElementType;
        struct MongoExtensionDistributedPlanLogicArrayElement {    
        // Type indicating what the union holds.    
        MongoExtensionDPLArrayElementType type;    
        union {         
        MongoExtensionAggregationStageParseNode* parseNode;         
        MongoExtensionAggregationLogicalStage* logicalStage;
            }};

      Similar work was done for the expansion array in https://github.com/mongodb/mongo/commit/881a554ecb2bacc2b94931144cf59ab6c950ad35 

      Once the DPLArray is populated by the extension, ownership is assumed to be transferred entirely to the Host.

            Assignee:
            Daniel Segel
            Reporter:
            Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: