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:
parent
8b5cc89641
commit
5d67df47e2
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user