diff --git a/zed_test.go b/zed_test.go index c05259c4cd..b3b949d07b 100644 --- a/zed_test.go +++ b/zed_test.go @@ -37,6 +37,7 @@ func TestZed(t *testing.T) { runAllBoomerangs(t, "arrows", data) runAllBoomerangs(t, "parquet", data) runAllBoomerangs(t, "vng", data) + runAllBoomerangs(t, "zjson", data) runAllBoomerangs(t, "zson", data) }) diff --git a/zio/zjsonio/reader.go b/zio/zjsonio/reader.go index e0c415850a..c9f368e455 100644 --- a/zio/zjsonio/reader.go +++ b/zio/zjsonio/reader.go @@ -74,6 +74,10 @@ func (r *Reader) decodeValue(b *zcode.Builder, typ zed.Type, body interface{}) e case *zed.TypeEnum: return r.decodeEnum(b, typ, body) case *zed.TypeRecord: + if body == nil { + b.Append(nil) + return nil + } return r.decodeRecord(b, typ, body) case *zed.TypeArray: err := r.decodeContainer(b, typ.Type, body, "array") diff --git a/zio/zjsonio/ztests/vals.yaml b/zio/zjsonio/ztests/vals.yaml index 9292bf70b9..e7a1f09939 100644 --- a/zio/zjsonio/ztests/vals.yaml +++ b/zio/zjsonio/ztests/vals.yaml @@ -19,6 +19,7 @@ inputs: null(int64) null(string) null(type) + null({}) outputs: - name: stdout