martin-traverse commented on code in PR #718:
URL: https://github.com/apache/arrow-java/pull/718#discussion_r2050404883


##########
adapter/avro/src/main/java/org/apache/arrow/adapter/avro/ArrowToAvroUtils.java:
##########
@@ -332,7 +332,17 @@ private static <T> T buildBaseTypeSchema(
 
       case List:
       case FixedSizeList:
-        return buildArraySchema(builder.array(), field, namespace);
+        // Arrow uses "$data$" as the field name for list items, that is not a 
valid Avro name
+        Field itemField = field.getChildren().get(0);
+        if (ListVector.DATA_VECTOR_NAME.equals(itemField.getName())) {

Review Comment:
   Hm, I think for list / map types using the constant defined names for 
children makes sense, with "item" instead of "$data$" for list items. More 
generally, we could normalise illegal chars to "_" to match the [Avro name 
rules](https://avro.apache.org/docs/1.12.0/specification/#names). Per my 
understanding similar rules are already enforced in C++, but are not part of 
the Arrow spec or Java implementation.
   
   Very happy to put the normalisation in, it's probably a more useful 
behaviour than throwing an error in the adapter. Would you like me to do it?



-- 
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