File tree Expand file tree Collapse file tree
datafusion/proto/src/logical_plan Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -506,11 +506,12 @@ mod parquet {
506506 fn try_from_proto (
507507 proto : & ParquetOptionsProto ,
508508 ) -> datafusion_common:: Result < Self , Self :: Error > {
509- let default_options = ParquetOptions :: default ( ) ;
510- let writer_version = if proto. writer_version . is_empty ( ) {
511- default_options. writer_version
512- } else {
513- proto. writer_version . parse ( ) ?
509+ let writer_version = match proto. writer_version . as_str ( ) {
510+ // Proto3 decodes an omitted string field as the empty string. The
511+ // schema documents writer_version's logical default as "1.0", so
512+ // preserve that default when the field is absent on the wire.
513+ "" => ParquetOptions :: default ( ) . writer_version ,
514+ version => version. parse ( ) ?,
514515 } ;
515516
516517 Ok ( ParquetOptions {
@@ -817,7 +818,7 @@ mod parquet {
817818 & TaskContext :: default ( ) ,
818819 ) ;
819820
820- let err = result. err ( ) . expect ( "invalid writer version should error" ) ;
821+ let err = result. expect_err ( "invalid writer version should error" ) ;
821822 assert ! (
822823 err. to_string( )
823824 . contains( "Invalid parquet writer version: 3.0" ) ,
You can’t perform that action at this time.
0 commit comments