alamb commented on code in PR #7834:
URL: https://github.com/apache/arrow-rs/pull/7834#discussion_r2197639644


##########
arrow-avro/src/reader/record.rs:
##########
@@ -37,34 +36,43 @@ use std::sync::Arc;
 const DEFAULT_CAPACITY: usize = 1024;
 
 /// Decodes avro encoded data into [`RecordBatch`]
+#[derive(Debug)]
 pub struct RecordDecoder {
     schema: SchemaRef,
     fields: Vec<Decoder>,
     use_utf8view: bool,
+    strict_mode: bool,
 }
 
 impl RecordDecoder {
     /// Create a new [`RecordDecoder`] from the provided [`AvroDataType`] with 
default options
     pub fn try_new(data_type: &AvroDataType) -> Result<Self, ArrowError> {
-        Self::try_new_with_options(data_type, ReadOptions::default())
+        Self::try_new_with_options(data_type, false, false)
     }
 
-    /// Create a new [`RecordDecoder`] from the provided [`AvroDataType`] with 
additional options
+    /// Creates a new [`RecordDecoder`] from the provided [`AvroDataType`] 
with additional options.
     ///
     /// This method allows you to customize how the Avro data is decoded into 
Arrow arrays.
     ///
-    /// # Parameters
-    /// * `data_type` - The Avro data type to decode
-    /// * `options` - Configuration options for decoding
+    /// # Arguments
+    /// * `data_type` - The Avro data type to decode.
+    /// * `use_utf8view` - A flag indicating whether to use `Utf8View` for 
string types.
+    /// * `strict_mode` - A flag to enable strict decoding, returning an error 
if the data
+    ///   does not conform to the schema.
+    ///
+    /// # Errors
+    /// This function will return an error if the provided `data_type` is not 
a `Record`.
     pub fn try_new_with_options(
         data_type: &AvroDataType,
-        options: ReadOptions,
+        use_utf8view: bool,

Review Comment:
   I was somewhat confused at first about this change as I thought it made the 
API harder to extend
   
   Then I realized that `RecordDecoder` is not `pub` anymore
   
   So maybe we could mark these methods and the struct as `pub(crate)` to be 
explicit that it is not re-exported outside



##########
arrow-avro/src/reader/mod.rs:
##########
@@ -15,11 +15,84 @@
 // specific language governing permissions and limitations
 // under the License.
 
-//! Read Avro data to Arrow
-
-use crate::reader::block::{Block, BlockDecoder};
-use crate::reader::header::{Header, HeaderDecoder};
-use arrow_schema::ArrowError;
+//! Avro reader

Review Comment:
   This interface is really nice 👍 



##########
arrow-avro/src/codec.rs:
##########
@@ -90,7 +90,7 @@ impl AvroDataType {
 #[derive(Debug, Clone)]
 pub struct AvroField {
     name: String,
-    data_type: AvroDataType,
+    pub(crate) data_type: AvroDataType,

Review Comment:
   why is this `pub(crate) needed? Not a big deal but it seems unecessary



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to