use of org.apache.parquet.thrift.test.compat.StructWithUnionV1 in project parquet-mr by apache.
the class TestThriftRecordConverter method constructorDoesNotRequireStructOrUnionTypeMeta.
@Test
public void constructorDoesNotRequireStructOrUnionTypeMeta() throws Exception {
String jsonWithNoStructOrUnionMeta = Strings.join(Files.readAllLines(new File("src/test/resources/org/apache/parquet/thrift/StructWithUnionV1NoStructOrUnionMeta.json"), Charset.forName("UTF-8")), "\n");
StructType noStructOrUnionMeta = (StructType) ThriftType.fromJSON(jsonWithNoStructOrUnionMeta);
// this used to throw, see PARQUET-346
new ThriftRecordConverter<StructWithUnionV1>(new ThriftReader<StructWithUnionV1>() {
@Override
public StructWithUnionV1 readOneRecord(TProtocol protocol) throws TException {
return null;
}
}, "name", new ThriftSchemaConverter().convert(StructWithUnionV1.class), noStructOrUnionMeta);
}
Aggregations