zed
zed copied to clipboard
Most functions don't support unions
While working on porting functions to work in the vectors I surprised to find that almost none of the functions properly handle union values:
$ echo '"foo"((int64,string))' | zq 'yield lower(this), upper(this), base64(this), cast(this, <bytes>), compare(this, "foo")' -
error({message:"lower: string arg required",on:"foo"((int64,string))})(error({message:string,on:(int64,string)}))
error({message:"upper: string arg required",on:"foo"((int64,string))})(error({message:string,on:(int64,string)}))
error({message:"base64: argument must a bytes or string type",on:"foo"((int64,string))})(error({message:string,on:(int64,string)}))
0x666f6f
1
Everything here except for cast does not behave as one would expect (note: compare should be returning 0).