You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "christofe lintermans (Jira)" <ji...@apache.org> on 2022/11/03 10:31:00 UTC

[jira] [Created] (FLINK-29864) AvroDeserializationSchema.forSpecific still generates genericdata.record

christofe lintermans created FLINK-29864:
--------------------------------------------

             Summary: AvroDeserializationSchema.forSpecific still generates genericdata.record
                 Key: FLINK-29864
                 URL: https://issues.apache.org/jira/browse/FLINK-29864
             Project: Flink
          Issue Type: Bug
          Components: API / DataStream
    Affects Versions: 1.15.2
            Reporter: christofe lintermans


I've generated AVRO classes based on AVRO specs.

But whatever I do, the AvroDeserializationSchema.forSpecific still generates GenericRecord objects instead of the desired destination classes.

I've also tried the RegistryAvroDeserializationSchema but the same issue pops up.
{code:java}
RegistryAvroDeserializationSchema<InputDataPoints> registryAvroDeserializationSchema = new RegistryAvroDeserializationSchema<>(
  InputDataPoints.class,
  null,
  () -> new SchemaCoder() {
          @Override
          public Schema readSchema(InputStream inputStream) throws IOException {
            return InputDataPoints.getClassSchema();
          }

          @Override
          public void writeSchema(Schema schema, OutputStream outputStream) throws IOException {
          }
});
 
{code}
 

When debugging, I notice SpecificDatumReader is being generated instead of GenericDatumReader, but still it produces the wrong types.

AvroSerializationSchema.forSpecific works fine and generates a correct byte array based on the AVRO classes objects.

Any suggestion how I can force the specific usage?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)