@@ -32,7 +32,9 @@ use datafusion::{
3232 } ,
3333 prelude:: { SessionConfig , SessionContext } ,
3434} ;
35- use datafusion_common:: { Constraints , DataFusionError , ParamValues , ScalarValue , Statistics } ;
35+ use datafusion_common:: {
36+ metadata:: ScalarAndMetadata , Constraints , DataFusionError , ParamValues , ScalarValue , Statistics ,
37+ } ;
3638use datafusion_expr:: {
3739 col, dml:: InsertOp , Expr , JoinType , LogicalPlan , LogicalPlanBuilder , SortExpr ,
3840 TableProviderFilterPushDown , TableType ,
@@ -550,7 +552,7 @@ impl TableProvider for MaterializedListingTable {
550552fn parse_partition_values (
551553 path : & ObjectPath ,
552554 partition_columns : & [ ( String , DataType ) ] ,
553- ) -> Result < Vec < ScalarValue > , DataFusionError > {
555+ ) -> Result < Vec < ScalarAndMetadata > , DataFusionError > {
554556 let parts = path. parts ( ) . map ( |part| part. to_owned ( ) ) . collect :: < Vec < _ > > ( ) ;
555557
556558 let pairs = parts
@@ -562,7 +564,7 @@ fn parse_partition_values(
562564 . iter ( )
563565 . map ( |( column, datatype) | {
564566 let value = pairs. get ( column. as_str ( ) ) . copied ( ) . map ( String :: from) ;
565- ScalarValue :: Utf8 ( value) . cast_to ( datatype)
567+ ScalarAndMetadata :: from ( ScalarValue :: Utf8 ( value) ) . cast_storage_to ( datatype)
566568 } )
567569 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
568570
0 commit comments