File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ impl<R: BufRead> Iterator for Reader<R> {
379379 type Item = Result < RecordBatch , ArrowError > ;
380380
381381 fn next ( & mut self ) -> Option < Self :: Item > {
382- self . read ( ) . transpose ( )
382+ self . read ( ) . transpose ( )
383383 }
384384}
385385
Original file line number Diff line number Diff line change @@ -43,13 +43,19 @@ pub(crate) struct RecordDecoderBuilder<'a> {
4343}
4444
4545impl < ' a > RecordDecoderBuilder < ' a > {
46- /// Sets whether to use `StringView` for string types.
46+ pub ( crate ) fn new ( data_type : & ' a AvroDataType ) -> Self {
47+ Self {
48+ data_type,
49+ use_utf8view : false ,
50+ strict_mode : false ,
51+ }
52+ }
53+
4754 pub ( crate ) fn with_utf8_view ( mut self , use_utf8view : bool ) -> Self {
4855 self . use_utf8view = use_utf8view;
4956 self
5057 }
5158
52- /// Sets the strict mode for decoding.
5359 pub ( crate ) fn with_strict_mode ( mut self , strict_mode : bool ) -> Self {
5460 self . strict_mode = strict_mode;
5561 self
@@ -72,19 +78,13 @@ pub(crate) struct RecordDecoder {
7278
7379impl RecordDecoder {
7480 /// Creates a new `RecordDecoderBuilder` for configuring a `RecordDecoder`.
75- pub ( crate ) fn new ( data_type : & ' _ AvroDataType ) -> RecordDecoderBuilder < ' _ > {
76- RecordDecoderBuilder {
77- data_type,
78- // default to false for utf8_view as per convention
79- use_utf8view : false ,
80- // default to false for strict_mode as per ReaderBuilder
81- strict_mode : false ,
82- }
81+ pub ( crate ) fn new ( data_type : & ' _ AvroDataType ) -> Self {
82+ RecordDecoderBuilder :: new ( data_type) . build ( ) . unwrap ( )
8383 }
8484
8585 /// Create a new [`RecordDecoder`] from the provided [`AvroDataType`] with default options
8686 pub ( crate ) fn try_new ( data_type : & AvroDataType ) -> Result < Self , ArrowError > {
87- Self :: new ( data_type)
87+ RecordDecoderBuilder :: new ( data_type)
8888 . with_utf8_view ( true )
8989 . with_strict_mode ( true )
9090 . build ( )
You can’t perform that action at this time.
0 commit comments