简体   繁体   中英

ClassCastException while using ThriftData for serializing Thrift data in Avro format

We are trying to find a way to serialize Thrift schema into Avro format.

The flow is as follows:

We have a project 'A' which uses Thrift. The output result object is a thrift based object.

We have project 'B' which uses Avro. We would like to read the project 'A' Thrift schema and produce compatible Avro schema for project 'B'.

We have tried using the ThriftData provided in Apache Avro to serialize the Thrift schema

Schema schema = thriftData.getSchema(XYZ.class);

The execution fails with the message

java.lang.RuntimeException: java.lang.ClassCastException: org.apache.thrift.meta_data.FieldValueMetaData cannot be cast to org.apache.thrift.meta_data.StructMetaData

Any help regarding this would be highly appreciated!

您可能需要检查valueMetaData属性以检查它是否具有正确的类型。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM