Skip to content

Vector runtime: sum aggregate with filter produces typed null instead of untyped null #6607

@mattnibs

Description

@mattnibs

Summary

When using sum with a filter clause inside aggregate, the vector runtime produces null::int64 (typed null) instead of null (untyped null) for groups that are entirely filtered out.

Reproduction

echo '{k:"foo",v:1} {k:"bar",v:2} {k:"foo",v:3} {k:"baz",v:4}' | super -s -c 'sum(v) filter (k=="bar") by key:=k | sort' -

Expected:

{key:"bar",sum:2}
{key:"baz",sum:null}
{key:"foo",sum:null}

Actual (vector):

{key:"bar",sum:2}
{key:"baz",sum:null::int64}
{key:"foo",sum:null::int64}

Test reference

book/src/super-sql/operators/aggregate.md:194

Discovered via make test-heavy which runs documentation examples through the vector runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions