dqkqd commented on code in PR #8765:
URL: https://github.com/apache/arrow-rs/pull/8765#discussion_r2484043798


##########
arrow-schema/src/datatype_parse.rs:
##########
@@ -88,80 +88,88 @@ impl<'a> Parser<'a> {
             Token::LargeListView => self.parse_large_list_view(),
             Token::FixedSizeList => self.parse_fixed_size_list(),
             Token::Struct => self.parse_struct(),
+            Token::Union => self.parse_union(),
+            Token::Map => self.parse_map(),
+            Token::RunEndEncoded => self.parse_run_end_encoded(),
             tok => Err(make_error(
                 self.val,
                 &format!("finding next type, got unexpected '{tok}'"),
             )),
         }
     }
 
-    /// Parses list field name. Returns default field name if not found.
-    fn parse_list_field_name(&mut self, context: &str) -> ArrowResult<String> {
-        // field must be after a comma
-        if self
+    /// parses Field, this is the inversion of `format_field` in 
`datatype_display.rs`.
+    /// E.g: "a": nullable Int64
+    ///
+    /// TODO: support metadata: `"a": nullable Int64 metadata: {"foo": 
"value"}`
+    fn parse_field(&mut self) -> ArrowResult<Field> {

Review Comment:
   There are `parse_field` and `parse_list_field` because we have two 
representation for `Field`:
   
   - In `Struct`, `Union`, `Map`, `RunEndEncoded`: `"a": nullable Int64`
   - In `List` types: `nullable Int64, field: 'a'`
   
   I don't think having two different representation for `Field` is a wise 
choice,
   but I don't change it in this PR.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to