From 8885be7d10ce84441a70271df5bded18951482b2 Mon Sep 17 00:00:00 2001 From: discord9 Date: Thu, 5 Nov 2026 15:45:16 +0800 Subject: [PATCH] fix(table): refuse a scan that plans interleaved ordering A scan's planned ordering is a guarantee its own partitions keep. Interleaved is the transport annotation for fragments several producers contribute, so a scanner that planned it has no raw-series read whose frame would honour that declaration. Reject it in the scan conversion, while the frame codec keeps accepting interleaved raw frames from the router that reconciles them. Signed-off-by: discord9 --- src/table/src/table/scan.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/table/src/table/scan.rs b/src/table/src/table/scan.rs index 7eadec286b5..ca4644424c2 100644 --- a/src/table/src/table/scan.rs +++ b/src/table/src/table/scan.rs @@ -614,6 +614,14 @@ impl RegionScanExec { let ordering = scanner .raw_series_ordering() .map_err(|e| DataFusionError::External(Box::new(e)))?; + // A scan's planned ordering is a guarantee its own partitions keep. Interleaved is a + // transport annotation for fragments several producers contribute; it is not something a + // single scanner can promise, so a scan that planned it is refused here. + if ordering == SeriesOrdering::Interleaved { + return Err(DataFusionError::Plan( + "a scan cannot plan interleaved raw series ordering".into(), + )); + } let arrow_schema = raw_series_frame_schema_with_ordering(&schema, &label_source, ordering)?; let partition_count = scanner.properties().num_partitions().max(1); let properties = Arc::new(PlanProperties::new(