1
1
mirror of https://github.com/wader/fq.git synced 2024-11-24 03:05:22 +03:00

avro_ocf: Fix panic on missing meta schema

This commit is contained in:
Mattias Wadman 2022-07-23 22:16:56 +02:00
parent 8b5cc89641
commit 5d67df47e2

View File

@ -70,7 +70,12 @@ func decodeHeader(d *decode.D) HeaderData {
d.Fatalf("header.meta is not a map")
}
headerData.Schema, err = schema.FromSchemaString(meta["avro.schema"].(string))
metaSchema, ok := meta["avro.schema"].(string)
if !ok {
d.Fatalf("missing meta avro.schema")
}
headerData.Schema, err = schema.FromSchemaString(metaSchema)
if err != nil {
d.Fatalf("failed to parse schema: %v", err)
}