brimdata / super

A novel data lake based on super-structured data
https://zed.brimdata.io/
BSD 3-Clause "New" or "Revised" License
1.39k stars 64 forks source link

tzng reader accepts bad record type #1222

Closed henridf closed 4 years ago

henridf commented 4 years ago
$ cat input.tzng 
#0:record[record[s:string]]
0:[-;]

$ zq -t  input.tzng 
#0:record[record[s:string]
0:[-;]

The tzng reader reads the above record as having a single field named record[s:. This would be technically correct if there wasn't the trailing ], but with it present, the typedef line should be a syntax error.

philrz commented 4 years ago

Verified in zq commit 4bce00d. Now the same input gives us the expected syntax error.

$ zq -t input.tzng 
input.tzng: format detection error
    tzng: line 1: syntax error parsing type string
    zeek: line 2: bad types/fields definition in zeek header
    ndjson: line 1: Unknown value type
    zjson: line 1: invalid character '#' looking for beginning of value
    zng: malformed zng record
    parquet: auto-detection not supported

Thanks @mccanne!