Skip to content

SQL: Vector runtime "panic: and'ing two different length bool vectors" #6429

@philrz

Description

@philrz

The following query produces a panic only in vector runtime.

$ super -f parquet -o tab0 -c "values {col0:97,col1:1,col2:99},{col0:15,col1:81,col2:47},{col0:87,col1:21,col2:10}" &&
SUPER_VAM=1 super -c "
SELECT ALL col2 / col0 AS col2 
FROM tab0 
WHERE -col1 - 31 NOT BETWEEN col2 AND 90 / -col2;"

panic: and'ing two different length bool vectors
goroutine 1 [running]:
runtime/debug.Stack()
	/usr/local/opt/go/libexec/src/runtime/debug/stack.go:26 +0x5e
github.com/brimdata/super/runtime/sam/op.(*Catcher).Pull.func1()
	/Users/phil/work/super/runtime/sam/op/catcher.go:25 +0x3d
panic({0x510ae60?, 0x545eae0?})
	/usr/local/opt/go/libexec/src/runtime/panic.go:783 +0x132
github.com/brimdata/super/vector/bitvec.And(...)
	/Users/phil/work/super/vector/bitvec/bits.go:153
github.com/brimdata/super/runtime/vam/expr.(*Compare).eval(0xc000188c30, {0xc0004ca240, 0xc000143400?, 0xc000143438?})
	/Users/phil/work/super/runtime/vam/expr/compare.go:75 +0xb4e
github.com/brimdata/super/vector.Apply(0xc0?, 0xc000030870?, {0xc0004ca240?, 0x2?, 0x52391c0?})
	/Users/phil/work/super/vector/apply.go:19 +0xf3
github.com/brimdata/super/vector.Apply-range1(...)
	/Users/phil/work/super/vector/apply.go:24
github.com/brimdata/super/vector.Apply.rip.func1(...)
	/Users/phil/work/super/vector/apply.go:52
github.com/brimdata/super/vector.Apply(0x1, 0xc0001435e8, {0xc0004ca200?, 0x1?, 0xc000412300?})
	/Users/phil/work/super/vector/apply.go:22 +0x185
github.com/brimdata/super/runtime/vam/expr.(*Compare).Eval(0xc000188c30, {0x5482150, 0xc000030550})
	/Users/phil/work/super/runtime/vam/expr/compare.go:27 +0xe5
github.com/brimdata/super/runtime/vam/expr.(*And).Eval(0xc000188c60, {0x5482150, 0xc000030550})
	/Users/phil/work/super/runtime/vam/expr/logic.go:60 +0x6b
github.com/brimdata/super/runtime/vam/expr.(*Not).Eval(0xc00013b4b8, {0x5482150?, 0xc000030550?})
	/Users/phil/work/super/runtime/vam/expr/logic.go:23 +0x38
github.com/brimdata/super/runtime/vam/op.(*Filter).Pull(0xc000188c90, 0x0)
	/Users/phil/work/super/runtime/vam/op/filter.go:25 +0x65
github.com/brimdata/super/runtime/vam/op.(*Values).Pull(0xc000188d80, 0x0)
	/Users/phil/work/super/runtime/vam/op/yield.go:28 +0x44
github.com/brimdata/super/runtime/vam.(*Materializer).Pull(0xc00059f9d0?, 0xd0?)
	/Users/phil/work/super/runtime/vam/materialize.go:26 +0x27
github.com/brimdata/super/runtime/sam/op.(*Single).Pull(0xc000188de0, 0x10?)
	/Users/phil/work/super/runtime/sam/op/mux.go:120 +0x33
github.com/brimdata/super/runtime/sam/op.(*Catcher).Pull(0x2b4e205192c88c52?, 0xa5?)
	/Users/phil/work/super/runtime/sam/op/catcher.go:28 +0x5c
github.com/brimdata/super/runtime/exec.(*Query).Pull(0x3489a3f?, 0xe0?)
	/Users/phil/work/super/runtime/exec/query.go:49 +0x3c
github.com/brimdata/super/sbuf.CopyMux(0xc000143d10, {0x546e220, 0xc000188e10})
	/Users/phil/work/super/sbuf/mux.go:39 +0x38
github.com/brimdata/super/cmd/super/root.(*Command).Run(0xc00030cb48, {0xc00003e8f0, 0x0, 0x0})
	/Users/phil/work/super/cmd/super/root/command.go:166 +0xa27
github.com/brimdata/super/pkg/charm.path.run({0xc000088a78, 0x1, 0x1}, {0xc00003e8f0, 0x0, 0x0?})
	/Users/phil/work/super/pkg/charm/path.go:11 +0x7b
github.com/brimdata/super/pkg/charm.(*Spec).Exec(0x65f3300, {0xc00003e8e0, 0x2, 0x2})
	/Users/phil/work/super/pkg/charm/charm.go:74 +0x1fa
main.main()
	/Users/phil/work/super/cmd/super/main.go:39 +0x5b

Details

Repro is with super commit 30f64bb. This is a simplification of a query from a sqllogictest (aka random/aggregates/slt_good_58/q11823).

Here's the same query producing the expected result in sequential runtime.

$ super -version
Version: 30f64bbac

$ super -f parquet -o tab0 -c "values {col0:97,col1:1,col2:99},{col0:15,col1:81,col2:47},{col0:87,col1:21,col2:10}" &&
super -c "
SELECT ALL col2 / col0 AS col2 
FROM tab0 
WHERE -col1 - 31 NOT BETWEEN col2 AND 90 / -col2;"

{col2:1}
{col2:3}
{col2:0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions