You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method is easy to use but has some limitations:
The output concurrency is always 1
The engine can't return more information about the query to callers
To maximize parallelism in #2806, the engine should provide a way to return multiple streams to scan different partitions of a region concurrently.
Implementation challenges
This issue proposes to add a new method to the region engine which supports partitioned scan. The method returns a trait object that can create a stream according to a partition index.
pubstructScannerProperties{// Properties of the scanner// e.g. number of partitions, range of partitions}pubtraitRegionScanner{fnproperties(&self) -> &ScannerProperties;fnscan_partition(&self,partition:usize) -> Result<SendableRecordBatchStream,BoxedError>;}pubtypeRegionScannerRef = Arc<dynRegionScanner>;pubtraitRegionEngine{asyncfnhandle_partitioned_query(&self,region_id:RegionId,request:ScanRequest,) -> Result<RegionScannerRef,BoxedError>;}
We could then use the scanner to implement a PhysicalPlan and let the query engine process multiple partitions. We might need to refactor the StreamScanAdapter as it assumes there is only one partition.
What type of enhancement is this?
API improvement
What does the enhancement do?
The
RegionEngine
trait provides ahandle_query()
method to scan a region and returns a stream ofRecordBatch
.greptimedb/src/store-api/src/region_engine.rs
Lines 136 to 140 in d997463
This method is easy to use but has some limitations:
To maximize parallelism in #2806, the engine should provide a way to return multiple streams to scan different partitions of a region concurrently.
Implementation challenges
This issue proposes to add a new method to the region engine which supports partitioned scan. The method returns a trait object that can create a stream according to a partition index.
We could then use the scanner to implement a
PhysicalPlan
and let the query engine process multiple partitions. We might need to refactor theStreamScanAdapter
as it assumes there is only one partition.greptimedb/src/table/src/table/scan.rs
Lines 103 to 119 in a6a702d
The text was updated successfully, but these errors were encountered: