zed icon indicating copy to clipboard operation
zed copied to clipboard

fuse should drop quiet errors

Open philrz opened this issue 3 years ago • 0 comments

Repro is with Zed commit 2eaa6d9. This issue is effectively another approach that could have helped with the community issue described in https://github.com/brimdata/zed/issues/3571#issuecomment-1252684022.

Start from this ZSON data that contains an error("quiet") value.

$ cat with_quiet.zson 
{
    ifname: "lo",
    address: "00:00:00:00:00:00",
    ip_addr: "127.0.0.1"
}
{
    ifname: "enp0s3",
    address: "08:00:27:61:d5:c7",
    ip_addr: "10.0.2.15"
}
{
    ifname: "enp0s8",
    address: "08:00:27:c9:4f:25",
    ip_addr: error("quiet")
}

When fuse is applied, the error is preserved as a value and hence we end up with a union type for ip_addr.

$ zq -version
Version: v1.2.0-51-g2eaa6d90

$ zq -Z 'fuse' with_quiet.zson 
{
    ifname: "lo",
    address: "00:00:00:00:00:00",
    ip_addr: "127.0.0.1" ((string,error(string)))
}
{
    ifname: "enp0s3",
    address: "08:00:27:61:d5:c7",
    ip_addr: "10.0.2.15" ((string,error(string)))
}
{
    ifname: "enp0s8",
    address: "08:00:27:c9:4f:25",
    ip_addr: error("quiet") ((string,error(string)))
}

We discussed this at a team sync and @mccanne agreed that it would have probably made sense for fuse to drop the "quiet" error, avoiding the need for the union type. So while we'd also not have been in this spot if a fix to #3571 had been in place, this change to fuse behavior would also cover situations where the error("quiet") came from somewhere other than a record literal.

philrz avatar Sep 20 '22 17:09 philrz