ABRiS icon indicating copy to clipboard operation
ABRiS copied to clipboard

get key from avro message

Open talperetz1 opened this issue 2 years ago • 3 comments

i have an Avro message and my avro message key look like this {"id":1} i want to get the name of the field in my key in this example id. there is any way to receive this with Abris Thank you

talperetz1 avatar Feb 01 '24 16:02 talperetz1

You can convert from Avro to Spark format, but you need to somehow get the Avro schema. The key and value are not really different in most cases.

cerveada avatar Feb 02 '24 12:02 cerveada

Hi, @cerveada I did it but the the fame i get is with column name from_avro(kafka_binary_key) and the value in this column is 1. So its look like the key "id" is missing from some reason. I expected to see column id and value 1

talperetz1 avatar Feb 04 '24 14:02 talperetz1

Couldn't you just rename the column name to 'key' then?

cerveada avatar Feb 05 '24 16:02 cerveada