@@ -34,6 +34,8 @@ use vortex_session::VortexSession;
3434
3535use crate :: ScanBuilder ;
3636use crate :: Selection ;
37+ use crate :: api:: DEFAULT_TARGET_OUTPUT_BYTES_HINT ;
38+ use crate :: api:: DEFAULT_TARGET_OUTPUT_ROWS_HINT ;
3739use crate :: api:: DataSource ;
3840use crate :: api:: DataSourceScan ;
3941use crate :: api:: DataSourceScanRef ;
@@ -166,6 +168,8 @@ impl DataSource for LayoutReaderDataSource {
166168 limit : scan_request. limit ,
167169 selection : scan_request. selection ,
168170 ordered : scan_request. ordered ,
171+ target_output_rows : scan_request. target_output_rows ,
172+ target_output_bytes : scan_request. target_output_bytes ,
169173 metrics_registry : self . metrics_registry . clone ( ) ,
170174 next_row : row_range. start ,
171175 end_row : row_range. end ,
@@ -187,6 +191,8 @@ struct LayoutReaderScan {
187191 limit : Option < u64 > ,
188192 ordered : bool ,
189193 selection : Selection ,
194+ target_output_rows : Option < usize > ,
195+ target_output_bytes : Option < usize > ,
190196 metrics_registry : Option < Arc < dyn MetricsRegistry > > ,
191197 next_row : u64 ,
192198 end_row : u64 ,
@@ -254,6 +260,8 @@ impl Stream for LayoutReaderScan {
254260 ordered : this. ordered ,
255261 row_range,
256262 selection : this. selection . clone ( ) ,
263+ target_output_rows : this. target_output_rows ,
264+ target_output_bytes : this. target_output_bytes ,
257265 metrics_registry : this. metrics_registry . clone ( ) ,
258266 } ) as PartitionRef ;
259267
@@ -281,6 +289,8 @@ struct LayoutReaderSplit {
281289 ordered : bool ,
282290 row_range : Range < u64 > ,
283291 selection : Selection ,
292+ target_output_rows : Option < usize > ,
293+ target_output_bytes : Option < usize > ,
284294 metrics_registry : Option < Arc < dyn MetricsRegistry > > ,
285295}
286296
@@ -312,8 +322,17 @@ impl Partition for LayoutReaderSplit {
312322 . with_projection ( self . projection )
313323 . with_some_filter ( self . filter )
314324 . with_some_limit ( self . limit )
315- . with_some_metrics_registry ( self . metrics_registry )
316325 . with_ordered ( self . ordered ) ;
326+ let builder = builder
327+ . with_target_output_rows (
328+ self . target_output_rows
329+ . unwrap_or ( DEFAULT_TARGET_OUTPUT_ROWS_HINT ) ,
330+ )
331+ . with_target_output_bytes (
332+ self . target_output_bytes
333+ . unwrap_or ( DEFAULT_TARGET_OUTPUT_BYTES_HINT ) ,
334+ ) ;
335+ let builder = builder. with_some_metrics_registry ( self . metrics_registry ) ;
317336
318337 let dtype = builder. dtype ( ) ?;
319338 // Use into_stream() which creates a LazyScanStream that spawns individual I/O
0 commit comments