Reduce boiler-plates in QO->QE stage mapping code

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • QE 2025-09-15, QE 2025-09-29, QE 2025-10-13
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently we have the macro REGISTER_AGG_STAGE_MAPPING taking 3 parameters, e.g.,:

      REGISTER_AGG_STAGE_MAPPING(querySettingsStage,
      DocumentSourceQuerySettings::id,
      documentSourceQuerySettingsToStageFn);

      We can reduce the number of parameters to just 1 (QO stage name), e.g.:

      REGISTER_AGG_STAGE_MAPPING(DocumentSourceQuerySettings);

      This modified macro will expect QO-stage-name-derived function defined, e.g.,

      boost::intrusive_ptr<exec::agg::Stage> mapDocumentSourceQuerySettingsToStage(
      const DocumentSource& ds)

      { ... }

      This will enforce unified function and initialization naming.

      If this function needs access to the document source's private members we can provide an additional macro

      FRIEND_AGG_STAGE_MAPPING(DocumentSourceQuerySettings); to avoid specifying the full function signature.

            Assignee:
            Romans Kasperovics
            Reporter:
            Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: