rdblue commented on code in PR #3212:
URL: https://github.com/apache/parquet-java/pull/3212#discussion_r2085695442


##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java:
##########
@@ -466,6 +466,21 @@ public Optional<Schema> visit(
                   LogicalTypeAnnotation.EnumLogicalTypeAnnotation 
enumLogicalType) {
                 return of(Schema.create(Schema.Type.STRING));
               }
+
+              @Override
+              public Optional<Schema> visit(
+                  LogicalTypeAnnotation.VariantLogicalTypeAnnotation 
variantLogicalType) {
+                String name = parquetGroupType.getName();
+                SchemaBuilder.FieldAssembler<Schema> builder = 
SchemaBuilder.builder(
+                        namespace(name, names))
+                    .record(name)
+                    .fields();
+                builder.name("metadata")
+                    .type(Schema.create(Schema.Type.BYTES))
+                    .noDefault();
+                
builder.name("value").type().optional().type(Schema.create(Schema.Type.BYTES));
+                return of(builder.endRecord());

Review Comment:
   Yeah, I think that adding the logical type here would allow the caller to 
convert this record into a `Variant` representation using Avro logical type 
converters. Not a high priority, but it would be a good addition.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to