Files
924060929 b0fd495574 [refactor](coordinator) Unify query execution in Coordinator (#69830)
### What problem does this PR solve?

Problem Summary:

FE still carries two execution coordinators: the legacy `Coordinator`
assigns scan ranges and fragment instances itself, while
`NereidsCoordinator` executes Nereids distributed plans but inherits the
legacy coordinator's state and initialization. `CloudCoordinator` adds
another legacy-only factory branch. This duplicates scheduling and
lifecycle ownership and retains a fallback that newer execution features
do not support.

Replace the legacy implementation with the standalone Nereids
implementation, renamed to `Coordinator`, and remove
`NereidsCoordinator` and `CloudCoordinator`. SQL, INSERT and background
load creation now use the same factory. Cloud compute-group selection,
privilege validation and backend membership remain in
`BackendDistributedPlanWorkerManager` during distributed planning.

Preserve the remaining shared capabilities explicitly: HTTP Stream Load
generates parameters with `ThriftPlansBuilder` and retains one fragment
instance on the receiving BE, matching its single completion callback;
Arrow Flight retains scans that must outlive dispatch; streaming INSERT
retains scan backend IDs; cancellation uses the runtime task state,
without treating remote-catalog workers as local backends. Group-commit
backend selection remains in distributed planning.

Keep set-operation bucket-shuffle scheduling markers aligned with the
selected child distribution, including when local shuffle is disabled,
so pruned scans retain all required bucket receivers.

Preserve backend-restart cancellation when a fragment captured an
uninitialized epoch (-1 or 0), while retaining the current-zero
replay/upgrade exception. Stabilize the nested full-outer-join EXPLAIN
with a statement-scoped bucket-shuffle downgrade setting, keeping the
outer-join elimination checks independent of actual backend count and
pipeline parallelism.

Migrate join-distribution assertions to effective statement-scoped
settings: cover both partitioned and bucket-shuffle plans, retain
exchange-count checks, and make pruning checks exercise the bucket path
without an early skip. Keep the removed setting where it still provides
compatibility coverage; do not mechanically rewrite unrelated test
expectations.

Retire `enable_nereids_distribute_planner` using the existing
removed-variable handling and remove its legacy-only optimizer branches.
Migrate unit fixtures to the distributed planner's query identity,
worker and local-exchange contracts. Regenerate EXPLAIN-shape
expectations with the Nereids distribution/property path while
preserving query-result checks.

### Release note

Use Nereids distributed planning for all queries and loads.
`enable_nereids_distribute_planner` no longer selects a planner;
existing SET statements for this removed variable remain accepted.
2026-11-04 14:48:23 +08:00
..