ThriftSchemaConverter#convert(StructType struct) introduced a backward incompatible logic in Parquet 1.8, If StructType's deprecated constructor is used to create StructTypes, and this convert method is used, then the client receives the following exception:
org.apache.parquet.ShouldNeverHappenException: EncounteredUNKNOWNStructOrUnionTypeatorg.apache.parquet.thrift.ThriftSchemaConvertVisitor.isUnion(ThriftSchemaConvertVisitor.java:342)
atorg.apache.parquet.thrift.ThriftSchemaConvertVisitor.visit(ThriftSchemaConvertVisitor.java:218)
atorg.apache.parquet.thrift.ThriftSchemaConvertVisitor.visit(ThriftSchemaConvertVisitor.java:74)
atorg.apache.parquet.thrift.struct.ThriftType$StructType.accept(ThriftType.java:269)
atorg.apache.parquet.thrift.ThriftSchemaConvertVisitor.convert(ThriftSchemaConvertVisitor.java:93)
atorg.apache.parquet.thrift.ThriftSchemaConverter.convert(ThriftSchemaConverter.java:75)
To illustrate the issue, here's a test case, which passes on older versions, but fails on master:
@TestpublicvoidtestIncompatibleThriftConverterChange() {
ThriftSchemaConverterconverter = newThriftSchemaConverter();
ThriftType.StructTypestructType = newThriftType.StructType(
asList(
newThriftField("a", (short)1, REQUIRED, newThriftType.StringType()),
newThriftField("b", (short) 2, REQUIRED, newThriftType.StringType())
)
);
converter.convert(structType);
}Reporter: Nándor Kollár / @nandorKollar
Assignee: Nándor Kollár / @nandorKollar
Related issues:
PRs and other links:
Note: This issue was originally created as PARQUET-1305. Please see the migration documentation for further details.
ThriftSchemaConverter#convert(StructType struct) introduced a backward incompatible logic in Parquet 1.8, If StructType's deprecated constructor is used to create StructTypes, and this convert method is used, then the client receives the following exception:
To illustrate the issue, here's a test case, which passes on older versions, but fails on master:
Reporter: Nándor Kollár / @nandorKollar
Assignee: Nándor Kollár / @nandorKollar
Related issues:
PRs and other links:
Note: This issue was originally created as PARQUET-1305. Please see the migration documentation for further details.