@@ -37,6 +37,7 @@ use datafusion_common::{
3737 TableParquetOptions ,
3838 } ,
3939 file_options:: { csv_writer:: CsvWriterOptions , json_writer:: JsonWriterOptions } ,
40+ not_impl_err,
4041 parsers:: CompressionTypeVariant ,
4142 plan_datafusion_err,
4243 stats:: Precision ,
@@ -257,7 +258,15 @@ impl TryFrom<&protobuf::arrow_type::ArrowTypeEnum> for DataType {
257258 arrow_type:: ArrowTypeEnum :: Interval ( interval_unit) => {
258259 DataType :: Interval ( parse_i32_to_interval_unit ( interval_unit) ?)
259260 }
260- arrow_type:: ArrowTypeEnum :: Decimal ( protobuf:: Decimal {
261+ arrow_type:: ArrowTypeEnum :: Decimal32 ( protobuf:: Decimal32Type {
262+ precision,
263+ scale,
264+ } ) => DataType :: Decimal32 ( * precision as u8 , * scale as i8 ) ,
265+ arrow_type:: ArrowTypeEnum :: Decimal64 ( protobuf:: Decimal64Type {
266+ precision,
267+ scale,
268+ } ) => DataType :: Decimal64 ( * precision as u8 , * scale as i8 ) ,
269+ arrow_type:: ArrowTypeEnum :: Decimal128 ( protobuf:: Decimal128Type {
261270 precision,
262271 scale,
263272 } ) => DataType :: Decimal128 ( * precision as u8 , * scale as i8 ) ,
@@ -469,6 +478,14 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
469478 let null_type: DataType = v. try_into ( ) ?;
470479 null_type. try_into ( ) . map_err ( Error :: DataFusionError ) ?
471480 }
481+ Value :: Decimal32Value ( _val) => {
482+ return not_impl_err ! ( "Decimal32 protobuf deserialization" )
483+ . map_err ( Error :: DataFusionError )
484+ }
485+ Value :: Decimal64Value ( _val) => {
486+ return not_impl_err ! ( "Decimal64 protobuf deserialization" )
487+ . map_err ( Error :: DataFusionError )
488+ }
472489 Value :: Decimal128Value ( val) => {
473490 let array = vec_to_array ( val. value . clone ( ) ) ;
474491 Self :: Decimal128 (
@@ -938,12 +955,6 @@ impl TryFrom<&protobuf::ParquetOptions> for ParquetOptions {
938955 protobuf:: parquet_options:: StatisticsEnabledOpt :: StatisticsEnabled ( v) => Some ( v) ,
939956 } )
940957 . unwrap_or ( None ) ,
941- max_statistics_size : value
942- . max_statistics_size_opt . as_ref ( )
943- . map ( |opt| match opt {
944- protobuf:: parquet_options:: MaxStatisticsSizeOpt :: MaxStatisticsSize ( v) => Some ( * v as usize ) ,
945- } )
946- . unwrap_or ( None ) ,
947958 max_row_group_size : value. max_row_group_size as usize ,
948959 created_by : value. created_by . clone ( ) ,
949960 column_index_truncate_length : value
@@ -1009,12 +1020,6 @@ impl TryFrom<&protobuf::ParquetColumnOptions> for ParquetColumnOptions {
10091020 protobuf:: parquet_column_options:: StatisticsEnabledOpt :: StatisticsEnabled ( v) => Some ( v) ,
10101021 } )
10111022 . unwrap_or ( None ) ,
1012- max_statistics_size : value
1013- . max_statistics_size_opt
1014- . map ( |opt| match opt {
1015- protobuf:: parquet_column_options:: MaxStatisticsSizeOpt :: MaxStatisticsSize ( v) => Some ( v as usize ) ,
1016- } )
1017- . unwrap_or ( None ) ,
10181023 encoding : value
10191024 . encoding_opt . clone ( )
10201025 . map ( |opt| match opt {
0 commit comments