aihuaxu commented on code in PR #3258:
URL: https://github.com/apache/parquet-java/pull/3258#discussion_r2249032710
##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java:
##########
@@ -470,11 +470,8 @@ public Optional<Schema> visit(
@Override
public Optional<Schema> visit(
LogicalTypeAnnotation.VariantLogicalTypeAnnotation
variantLogicalType) {
- String name = parquetGroupType.getName();
- List<Schema.Field> fields = new ArrayList<>();
- fields.add(new Schema.Field("metadata",
Schema.create(Schema.Type.BYTES)));
- fields.add(new Schema.Field("value",
Schema.create(Schema.Type.BYTES)));
- return of(Schema.createRecord(name, null, namespace(name,
names), false, fields));
+ return of(
Review Comment:
It's in the test code that we use AvroSchemaConverter to create the schema
in
https://github.com/apache/iceberg/blob/main/parquet/src/test/java/org/apache/iceberg/parquet/TestVariantReaders.java#L1597.
With the current logic, if we pass in a shredded variant type like
```
GroupType variantType =
Types.buildGroup(Type.Repetition.REQUIRED)
.as(LogicalTypeAnnotation.variantType((byte)1))
.id(2)
.required(PrimitiveTypeName.BINARY)
.named("metadata")
.addField(objectFields)
.named("var");
```
We are converted to a record of `value` and `metadata`, then we cannot set
the value for `typed_value`.
--
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]