Disallow extensions to specify host-allocated nodes in DPL with extension BSON

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, DocumentSourceExtensionOptimizable::distributedPlanLogic operates under the assumption that if an extension is returning a host-allocated parse node, the BSON spec corresponds to an actual host stage. However, there are no guardrails preventing an extension developer from returning a host-allocated parse node with the BSON of an extension stage.

      If this were to happen, DocumentSource:: parse() would look at the BSON, see that it's an extension, and create a LiteParsedExpandable object which would later convert to DocumentSourceExtensionForQueryShape. Notably, there would be no expansion that converts LiteParsedExpandable to LiteParsedExpanded. When transitioning from optimization to execution, DocumentSourceExtensionForQueryShape has no corresponding execution form as designed, causing a generic stage mapping error message.

      This PR should add a more helpful error message when it's detected that the host-allocated parse node holds extension BSON.

            Assignee:
            Josh Siegel
            Reporter:
            Josh Siegel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: