AbsaOSS / ABRiS

Avro SerDe for Apache Spark structured APIs.
Apache License 2.0
231 stars 76 forks source link

get key from avro message #354

Open talperetz1 opened 9 months ago

talperetz1 commented 9 months ago

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

cerveada commented 9 months ago

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.

talperetz1 commented 9 months ago

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

cerveada commented 9 months ago

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