Closed mccanne closed 4 years ago
That said, it seems like you should be able to say @foo=val
in zql so there is a little design work to be done here...
Verified in zq
commit d9caaa9
.
Now special characters like .
and @
can appear in field names, and the ZQL language provides the ["..."]
notation for escaping these when they need to be referenced, such as below where I successfully match on the event when filtering on the field by name.
$ cat input.tzng
#0:record[r:record[[.bar@]:int32,x:string]]
0:[[123;hello;]]
$ zq -t 'r[".bar@"]=123' input.tzng
#0:record[r:record[[.bar@]:int32,x:string]]
0:[[123;hello;]]
Thanks @mccanne!
Relax the syntax for zng columns names. We currently require conformance with JSON identifiers but even javascript and JSON allow object keys to be arbitrary keys. Thus to properly ingest any JSON, we should support arbitrary strings as keys. This means we will need a zql special syntax to support record accesses that have special chars and we might as well follow javascript convention e.g.,
rec.@foo
should berec["@foo"]
.