Update MongoExtensionLogicalAggStage to support reporting metadata

XMLWordPrintableJSON

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

      Extension stages must be able to report the metadata fields that it requires along with the metadata fields that it provides. This information will be gathered by the pipeline using the overridden method `getDependencies()` on `DocumentSource`. Because this will called after desugaring, we need to override this method on `DocumentSourceExtensionOptimizable` (separate ticket).

      We will introduce two new expected fields in the BSON populated by `MongoExtensionAggStageAstNodeVTable::get_properties()`. This BSON is modeled by the `MongoExtensionStaticProperties` IDL. Additionally, the extension can report whether or not the incoming metadata is preserved and passed through to the downstream stage. The static properties are currently cached on `DocumentSourceExtensionOptimizable` during initialization, allowing them to be accessed during the `getDependencies()` override.

      // Modeled in IDL
      MongoExtensionStaticProperties:
          // Existing description and fields.
          fields:
              requiredMetadataFields: 
                  type: array<string>
                  optional: true
                  default: []
              providedMetadataFields:
                  type: array<string>
                  optional: true
                  default: []
              preservesUpstreamMetadata:
                  type: bool
                  optional: true
                  default: true

      This ticket should add these functions to IDL and add unit tests. This ticket should not make any changes to the host side.

            Assignee:
            Aditya Deshpande
            Reporter:
            Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: