2626use std:: fmt:: Debug ;
2727use std:: sync:: Arc ;
2828
29- use arrow_array :: types:: UInt16Type ;
30- use arrow_array :: { Array , DictionaryArray , RecordBatch , StringArray , TypedDictionaryArray } ;
29+ use arrow :: array :: types:: UInt16Type ;
30+ use arrow :: array :: { Array , DictionaryArray , RecordBatch , StringArray , TypedDictionaryArray } ;
3131use arrow_cast:: display:: array_value_to_string;
3232use arrow_cast:: { cast_with_options, CastOptions } ;
3333use arrow_schema:: {
@@ -41,7 +41,7 @@ use datafusion::common::{
4141} ;
4242use datafusion:: datasource:: physical_plan:: wrap_partition_type_in_dict;
4343use datafusion:: datasource:: { MemTable , TableProvider } ;
44- use datafusion:: execution:: context:: { SessionConfig , SessionContext } ;
44+ use datafusion:: execution:: context:: SessionContext ;
4545use datafusion:: execution:: runtime_env:: RuntimeEnv ;
4646use datafusion:: execution:: FunctionRegistry ;
4747use datafusion:: logical_expr:: logical_plan:: CreateExternalTable ;
@@ -50,7 +50,6 @@ use datafusion::logical_expr::{Expr, Extension, LogicalPlan};
5050use datafusion:: physical_optimizer:: pruning:: PruningPredicate ;
5151use datafusion:: physical_plan:: metrics:: ExecutionPlanMetricsSet ;
5252use datafusion:: physical_plan:: { ExecutionPlan , Statistics } ;
53- use datafusion:: sql:: planner:: ParserOptions ;
5453use datafusion_proto:: logical_plan:: LogicalExtensionCodec ;
5554use datafusion_proto:: physical_plan:: PhysicalExtensionCodec ;
5655use delta_kernel:: engine:: arrow_conversion:: TryIntoArrow as _;
@@ -71,6 +70,7 @@ use crate::table::state::DeltaTableState;
7170use crate :: table:: { Constraint , GeneratedColumn } ;
7271use crate :: { open_table, open_table_with_storage_options, DeltaTable } ;
7372
73+ pub use self :: session:: * ;
7474pub ( crate ) use find_files:: * ;
7575
7676pub ( crate ) const PATH_COLUMN : & str = "__delta_rs_path" ;
@@ -83,6 +83,7 @@ pub mod logical;
8383pub mod physical;
8484pub mod planner;
8585mod schema_adapter;
86+ mod session;
8687mod table_provider;
8788
8889pub use cdf:: scan:: DeltaCdfTableProvider ;
@@ -125,7 +126,7 @@ pub trait DataFusionMixins {
125126 fn parse_predicate_expression (
126127 & self ,
127128 expr : impl AsRef < str > ,
128- session : & impl Session ,
129+ session : & dyn Session ,
129130 ) -> DeltaResult < Expr > ;
130131}
131132
@@ -149,7 +150,7 @@ impl DataFusionMixins for Snapshot {
149150 fn parse_predicate_expression (
150151 & self ,
151152 expr : impl AsRef < str > ,
152- session : & impl Session ,
153+ session : & dyn Session ,
153154 ) -> DeltaResult < Expr > {
154155 let schema = DFSchema :: try_from ( self . read_schema ( ) . as_ref ( ) . to_owned ( ) ) ?;
155156 parse_predicate_expression ( & schema, expr, session)
@@ -188,7 +189,7 @@ impl DataFusionMixins for LogDataHandler<'_> {
188189 fn parse_predicate_expression (
189190 & self ,
190191 expr : impl AsRef < str > ,
191- session : & impl Session ,
192+ session : & dyn Session ,
192193 ) -> DeltaResult < Expr > {
193194 let schema = DFSchema :: try_from ( self . read_schema ( ) . as_ref ( ) . to_owned ( ) ) ?;
194195 parse_predicate_expression ( & schema, expr, session)
@@ -207,7 +208,7 @@ impl DataFusionMixins for EagerSnapshot {
207208 fn parse_predicate_expression (
208209 & self ,
209210 expr : impl AsRef < str > ,
210- session : & impl Session ,
211+ session : & dyn Session ,
211212 ) -> DeltaResult < Expr > {
212213 self . snapshot ( ) . parse_predicate_expression ( expr, session)
213214 }
@@ -792,67 +793,6 @@ impl TableProviderFactory for DeltaTableFactory {
792793 }
793794}
794795
795- /// A wrapper for sql_parser's ParserOptions to capture sane default table defaults
796- pub struct DeltaParserOptions {
797- inner : ParserOptions ,
798- }
799-
800- impl Default for DeltaParserOptions {
801- fn default ( ) -> Self {
802- DeltaParserOptions {
803- inner : ParserOptions {
804- enable_ident_normalization : false ,
805- ..ParserOptions :: default ( )
806- } ,
807- }
808- }
809- }
810-
811- impl From < DeltaParserOptions > for ParserOptions {
812- fn from ( value : DeltaParserOptions ) -> Self {
813- value. inner
814- }
815- }
816-
817- /// A wrapper for Deltafusion's SessionConfig to capture sane default table defaults
818- pub struct DeltaSessionConfig {
819- inner : SessionConfig ,
820- }
821-
822- impl Default for DeltaSessionConfig {
823- fn default ( ) -> Self {
824- DeltaSessionConfig {
825- inner : SessionConfig :: default ( )
826- . set_bool ( "datafusion.sql_parser.enable_ident_normalization" , false ) ,
827- }
828- }
829- }
830-
831- impl From < DeltaSessionConfig > for SessionConfig {
832- fn from ( value : DeltaSessionConfig ) -> Self {
833- value. inner
834- }
835- }
836-
837- /// A wrapper for Deltafusion's SessionContext to capture sane default table defaults
838- pub struct DeltaSessionContext {
839- inner : SessionContext ,
840- }
841-
842- impl Default for DeltaSessionContext {
843- fn default ( ) -> Self {
844- DeltaSessionContext {
845- inner : SessionContext :: new_with_config ( DeltaSessionConfig :: default ( ) . into ( ) ) ,
846- }
847- }
848- }
849-
850- impl From < DeltaSessionContext > for SessionContext {
851- fn from ( value : DeltaSessionContext ) -> Self {
852- value. inner
853- }
854- }
855-
856796/// A wrapper for Deltafusion's Column to preserve case-sensitivity during string conversion
857797pub struct DeltaColumn {
858798 inner : Column ,
@@ -914,7 +854,7 @@ mod tests {
914854 use datafusion:: logical_expr:: lit;
915855 use datafusion:: physical_plan:: empty:: EmptyExec ;
916856 use datafusion:: physical_plan:: { visit_execution_plan, ExecutionPlanVisitor , PhysicalExpr } ;
917- use datafusion:: prelude:: col;
857+ use datafusion:: prelude:: { col, SessionConfig } ;
918858 use datafusion_proto:: physical_plan:: AsExecutionPlan ;
919859 use datafusion_proto:: protobuf;
920860 use delta_kernel:: path:: { LogPathFileType , ParsedLogPath } ;
0 commit comments