Skip to content

[Feature Request]: Substrait plan offload to Sirius sidecar #26154

Todo

Description

@aunjgr

Summary

Introduce a production-grade MatrixOne-to-Sirius sidecar path in which MatrixOne exports an eligible optimized logical SQL query as Substrait, Sirius executes it through its GPU planner, and results stream back under the original MySQL query's memory, cancellation, authentication, and snapshot-visibility guarantees.

This replaces the prototype SQL-over-HTTP and fully buffered JSON path, not merely its serialization format.

Design boundaries

  • Export a complete bounded logical query, never a MatrixOne distributed physical pipeline and never a phase-one hybrid plan.
  • Represent TAE input as a versioned ReadRel.ExtensionTable with an opaque, authenticated read reference. Plans contain no manifest URLs, object-store credentials, or reusable capabilities.
  • Pin snapshot, schema, immutable object set, and retention lease before execution. Phase one rejects unflushed data and visibility-dependent tombstones.
  • Import Substrait into a DuckDB logical plan but execute it through the Sirius physical planner, never ordinary DuckDB CPU execution.
  • Stream Arrow Flight batches through MatrixOne's existing MySQL result writer with bounded in-flight memory and exactly-once cancellation and cleanup.
  • Fall back to native MatrixOne only before any result schema or row is visible.

Delivered foundations

TPC-H implementation under review

The remaining product implementation is filed as four dependency-ordered PRs:

  1. feat: import Substrait anti joins duckdb-substrait#2 — import MatrixOne left/right anti joins with SQL NULL and duplicate semantics.
  2. feat: validate MatrixOne TPC-H Substrait plans sirius#4 — validate the exact TPC-H relation/expression/type/function surface, seven required join modes, authenticated database_id, and bounded backward references.
  3. feat: extend Flight offload to TPC-H plans mo-sirius-sidecar#6 — publish the exact capability contract and bind Flight ticket, cancellation, quiescence, resolver, and lease ownership.
  4. feat: execute Sirius Substrait reads through Flight #26981 — export every canonical optimized TPC-H Q1-Q22 plan and integrate exact Flight streaming into CN/frontend/compiler lifecycle.

MatrixOne's Q15 CTE is already inlined in the canonical optimized plan. None of these PRs changes CTE planning. Bounded Sink/ReferenceRel support is contract coverage only, not a prerequisite for the canonical Q15 export.

Remaining after the four PRs merge

#26159 is the only substantive remaining delivery:

  • run all 22 TPC-H queries natively and offloaded and compare typed results;
  • prove actual Sirius GPU execution rather than DuckDB CPU fallback; and
  • exercise storage races, slow clients, disconnects, cancellation, sidecar failure, schema mismatch, and cleanup.

Subtasks

Merge order

duckdb-substrait#2 -> sirius#4 -> mo-sirius-sidecar#6 -> matrixone#26981 -> #26159 E2E closure.

Full mutable-table support with snapshot-correct tombstone application remains outside phase one. Unsafe states must fall back before execution, never return approximate results.

Activity

  1. self-assigned this
    on Jul 24, 2026
  2. aunjgr commented on Aug 21, 2026

    @aunjgr
    ContributorAuthor
    Status update: #26155, #26156, and #26158 are now closed as delivered; #26157 was already complete. The merged stack is duckdb-substrait#2, sirius#4, mo-sirius-sidecar#6, matrixone#26981, and the system-account fix #27409. #26159 is the sole remaining subtask: record Q1-Q22 native-versus-Sirius typed equality with affirmative Sirius GPU evidence, then execute the required storage-race and terminal-lifecycle fault cases. #26154 remains open until that evidence is complete.
  3. assigned and unassigned on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions