AbsaOSS / ABRiS

Avro SerDe for Apache Spark structured APIs.
Apache License 2.0
227 stars 73 forks source link

get key from avro message #354

Open talperetz1 opened 7 months ago

talperetz1 commented 7 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 7 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 7 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 7 months ago

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