Skip to content

Commit

Permalink
avro_ocf: Fix panic on missing meta schema
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Jul 23, 2022
1 parent 8b5cc89 commit 5d67df4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion format/avro/avro_ocf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5d67df4

Please sign in to comment.