Hi,
I am trying to test loading data using the KafkaAVROParser. I have configured the topic with the following parameters:
parser=KafkaAVROParser
parser-parameters=flatten_maps=TRUE,flatten_arrays=TRUE,codec='default',external_schema='{ "type": "record", "namespace": "org.foo", "name": "test", "fields": [ { "name":
"dim", "type": "string" }] }'
I am sending the data as follows to the Kafka topic:
DatumWriter<GenericRecord>writer = new GenericDatumWriter<GenericRecord>(schema);
GenericRecord record = new GenericData.Record(schema);
record.put("dim", new Utf8("dim"));
ByteArrayOutputStream out = new ByteArrayOutputStream();
BinaryEncoder encoder = EncoderFactory.get().binaryEncoder(out, null);
writer.write(record, encoder);
encoder.flush();
out.close();
byte[] msgBytes = out.toByteArray();
KeyedMessage<String, byte[]> message = new KeyedMessage<String, byte[]>("test_topic_2",msgBytes);
producer.send(message);
Whenever I send data to the kafka topic I get the following error in the Vertica rejection table:
Error creating reader for avro, data/schema not supported.
Note: Codec supported is avro null or snappy
When using external_schema messages cannot contain header(AVRO_MAGIC, AVRO_CODEC_KEY,AVRO_SCHEMA_KEY) and/or schema
I must have misconfigured the schema but cannot figure out what the problem is.
If someone has an example of how to configure the KafkaAVROParser with an external schema that would be a great help.
Thanks,
Jim