@@ -75,7 +75,7 @@ pub struct Metadata {
7575 non_lazy_columns : ColumnSet ,
7676 /// Mappings from table index to _row_id column index.
7777 table_row_id_index : HashMap < IndexType , Symbol > ,
78- agg_indices : HashMap < String , Vec < ( u64 , String , SExpr ) > > ,
78+ agg_indices : HashMap < String , Vec < AggIndexPlan > > ,
7979 max_column_position : usize , // for CSV
8080
8181 /// Scan id of each scan operator.
@@ -86,6 +86,13 @@ pub struct Metadata {
8686 next_logical_recursive_cte_id : u32 ,
8787}
8888
89+ #[ derive( Clone , Debug ) ]
90+ pub struct AggIndexPlan {
91+ pub index_id : u64 ,
92+ pub sql : String ,
93+ pub s_expr : SExpr ,
94+ }
95+
8996impl Metadata {
9097 fn next_column_index ( & self ) -> Symbol {
9198 Symbol :: new ( self . columns . len ( ) )
@@ -333,7 +340,7 @@ impl Metadata {
333340 column_index
334341 }
335342
336- pub fn add_agg_indices ( & mut self , table : String , agg_indices : Vec < ( u64 , String , SExpr ) > ) {
343+ pub fn add_agg_indices ( & mut self , table : String , agg_indices : Vec < AggIndexPlan > ) {
337344 match self . agg_indices . entry ( table) {
338345 Entry :: Occupied ( occupied) => occupied. into_mut ( ) . extend ( agg_indices) ,
339346 Entry :: Vacant ( vacant) => {
@@ -342,15 +349,15 @@ impl Metadata {
342349 }
343350 }
344351
345- pub fn agg_indices ( & self ) -> & HashMap < String , Vec < ( u64 , String , SExpr ) > > {
352+ pub fn agg_indices ( & self ) -> & HashMap < String , Vec < AggIndexPlan > > {
346353 & self . agg_indices
347354 }
348355
349- pub fn replace_agg_indices ( & mut self , agg_indices : HashMap < String , Vec < ( u64 , String , SExpr ) > > ) {
356+ pub fn replace_agg_indices ( & mut self , agg_indices : HashMap < String , Vec < AggIndexPlan > > ) {
350357 self . agg_indices = agg_indices
351358 }
352359
353- pub fn get_agg_indices ( & self , table : & str ) -> Option < & [ ( u64 , String , SExpr ) ] > {
360+ pub fn get_agg_indices ( & self , table : & str ) -> Option < & [ AggIndexPlan ] > {
354361 self . agg_indices . get ( table) . map ( |v| v. as_slice ( ) )
355362 }
356363
0 commit comments