11use datafusion:: { arrow:: datatypes:: DataType , logical_plan:: Column } ;
2- use itertools:: Itertools ;
32use std:: { collections:: HashMap , ops:: RangeFrom , sync:: Arc } ;
43use uuid:: Uuid ;
54
@@ -11,8 +10,6 @@ use super::{CubeMeta, CubeMetaDimension, CubeMetaMeasure, V1CubeMetaExt};
1110pub struct MetaContext {
1211 pub cubes : Vec < CubeMeta > ,
1312 pub tables : Vec < CubeMetaTable > ,
14- // TODO remove this in favor of `member_to_data_source`
15- pub cube_to_data_source : HashMap < String , String > ,
1613 pub member_to_data_source : HashMap < String , String > ,
1714 pub data_source_to_sql_generator : HashMap < String , Arc < dyn SqlGenerator + Send + Sync > > ,
1815 pub compiler_id : Uuid ,
@@ -111,30 +108,13 @@ impl MetaContext {
111108 Self {
112109 cubes,
113110 tables,
114- cube_to_data_source,
115111 member_to_data_source,
116112 data_source_to_sql_generator,
117113 compiler_id,
118114 created_at : chrono:: Utc :: now ( ) ,
119115 }
120116 }
121117
122- // TODO remove this in favor of source-per-member
123- pub fn sql_generator_by_alias_to_cube (
124- & self ,
125- alias_to_cube : & Vec < ( String , String ) > ,
126- ) -> Option < Arc < dyn SqlGenerator + Send + Sync > > {
127- let data_source = alias_to_cube
128- . iter ( )
129- . map ( |( _, c) | self . cube_to_data_source . get ( c) )
130- . all_equal_value ( ) ;
131-
132- // Don't care for non-equal data sources, nor for missing cube_to_data_source keys
133- let data_source = data_source. ok ( ) ??;
134-
135- self . data_source_to_sql_generator . get ( data_source) . cloned ( )
136- }
137-
138118 pub fn data_source_for_member_name ( & self , member : & str ) -> Result < DataSource , DataSourceError > {
139119 if self . is_synthetic_field ( member) {
140120 return Ok ( DataSource :: Unrestricted ) ;
0 commit comments