Skip to content

PhysicalASAPDAG::validate does not check per-operator timing #656

Open

Description

@zzylol

Found in the #541 review.

Problem

PhysicalASAPDAG::validate (and with_execution_phases) checks edge roles and the query-time → ingestion-time edge rule, but not the timing each operator kind requires. For example, it accepts:

  • Scan → SummaryAgg → Finalize with every node at ingestion time, which the timing pass rejects as MaintenanceRowsAtRoot;
  • a SummaryAgg whose output_state.primitive is Raw.

It doesn't check:

  • that SummaryEstimate / EvaluatePopulation run at query time and MaintainPopulation at ingestion time;
  • the ingestion-time BinaryOp rules;
  • that primitive equals what data_state derives.

Today only the compiler produces these DAGs, from plans the timing pass has already checked, so nothing invalid reaches the runtime. It matters once a DAG is deserialized or re-phased, as in the backend stack. The runtime branches on output_state.timing: an ingestion-time BinaryOp compiles to aligned_binary, which ignores vector_match.

Possible fix

In validate, check each node's timing and primitive against its operator kind, reusing the rules in ir/timing.rs and data_state rather than copying them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions