@@ -50,12 +50,14 @@ use crate::sessions::QueryAffect;
50
50
use crate :: sessions:: QueryContext ;
51
51
use crate :: sessions:: Session ;
52
52
use crate :: sessions:: TableContext ;
53
- use crate :: spillers:: Spiller ;
53
+ use crate :: spillers:: PortableSpiller ;
54
+ use crate :: spillers:: PortableSpillerRef ;
54
55
use crate :: spillers:: SpillerConfig ;
55
56
use crate :: spillers:: SpillerDiskConfig ;
56
- use crate :: spillers:: SpillerRef ;
57
57
use crate :: spillers:: SpillerType ;
58
58
59
+ type Sender = SizedChannelSender < PortableSpillerRef > ;
60
+
59
61
pub struct ExecutionError ;
60
62
61
63
#[ derive( Serialize , Deserialize , Debug , Copy , Clone , PartialEq , Eq ) ]
@@ -120,7 +122,7 @@ impl ExecuteState {
120
122
121
123
pub struct ExecuteStarting {
122
124
pub ( crate ) ctx : Arc < QueryContext > ,
123
- pub ( crate ) sender : SizedChannelSender < SpillerRef > ,
125
+ pub ( crate ) sender : Sender ,
124
126
}
125
127
126
128
pub struct ExecuteRunning {
@@ -361,7 +363,7 @@ impl ExecuteState {
361
363
sql : String ,
362
364
session : Arc < Session > ,
363
365
ctx : Arc < QueryContext > ,
364
- mut block_sender : SizedChannelSender < SpillerRef > ,
366
+ mut block_sender : Sender ,
365
367
) -> Result < ( ) , ExecutionError > {
366
368
let make_error = || format ! ( "failed to start query: {sql}" ) ;
367
369
@@ -426,7 +428,7 @@ impl ExecuteState {
426
428
interpreter : Arc < dyn Interpreter > ,
427
429
schema : DataSchemaRef ,
428
430
ctx : Arc < QueryContext > ,
429
- mut block_sender : SizedChannelSender < SpillerRef > ,
431
+ mut block_sender : Sender ,
430
432
executor : Arc < Mutex < Executor > > ,
431
433
) -> Result < ( ) , ExecutionError > {
432
434
let make_error = || format ! ( "failed to execute {}" , interpreter. name( ) ) ;
@@ -471,7 +473,7 @@ impl ExecuteState {
471
473
}
472
474
473
475
async fn send_data_block (
474
- sender : & mut SizedChannelSender < SpillerRef > ,
476
+ sender : & mut Sender ,
475
477
executor : & Arc < Mutex < Executor > > ,
476
478
block : DataBlock ,
477
479
) -> Result < ( ) > {
@@ -484,10 +486,7 @@ impl ExecuteState {
484
486
}
485
487
}
486
488
487
- fn apply_settings (
488
- ctx : & Arc < QueryContext > ,
489
- block_sender : & mut SizedChannelSender < SpillerRef > ,
490
- ) -> Result < ( ) > {
489
+ fn apply_settings ( ctx : & Arc < QueryContext > , block_sender : & mut Sender ) -> Result < ( ) > {
491
490
let settings = ctx. get_settings ( ) ;
492
491
493
492
let spiller = if settings. get_enable_result_set_spilling ( ) ? {
@@ -507,7 +506,7 @@ impl ExecuteState {
507
506
use_parquet : settings. get_spilling_file_format ( ) ?. is_parquet ( ) ,
508
507
} ;
509
508
let op = DataOperator :: instance ( ) . spill_operator ( ) ;
510
- Some ( Spiller :: create ( ctx . clone ( ) , op, config) ?. into ( ) )
509
+ Some ( PortableSpiller :: create ( op, config) ?)
511
510
} else {
512
511
None
513
512
} ;
0 commit comments