aihuaxu commented on code in PR #12238:
URL: https://github.com/apache/iceberg/pull/12238#discussion_r1964486203


##########
core/src/main/java/org/apache/iceberg/avro/TypeToSchema.java:
##########
@@ -187,6 +187,21 @@ public Schema map(Types.MapType map, Schema keySchema, 
Schema valueSchema) {
     return mapSchema;
   }
 
+  @Override
+  public Schema variant() {
+    String recordName = "r" + fieldIds.peek();

Review Comment:
   You mean to change the following namesFunction so the user can provide the 
naming mapping, right? I can address in the following PR.
   
   >   private final BiFunction<Integer, Types.StructType, String> 
namesFunction;
   
   BTW: I also update for struct to use default `table` as the name when the id 
is null.  
   
   >   public Schema struct(Types.StructType struct, List<Schema> fieldSchemas) 
{
   >     Integer fieldId = fieldIds.peek();
   >     String recordName = namesFunction.apply(fieldId, struct);
   >     if (recordName == null) {
   >       recordName = fieldId != null ? "r" + fieldId : "table";
   >     }



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to