arr-ai / arrai

The ultimate data engine.
http://arr.ai
Apache License 2.0
20 stars 15 forks source link

Accessing empty tuple key panics if not present #572

Closed orlade-anz closed 4 years ago

orlade-anz commented 4 years ago

Please do not post any internal, closed source snippets on this public issue tracker!

Description

Steps to Reproduce

  1. (a: 1).''

Expected behavior

Missing attr "" (available: |a|)

Actual behavior

panic: runtime error: slice bounds out of range [:1] with length 0

goroutine 1 [running]:
github.com/arr-ai/arrai/rel.(*DotExpr).Eval.func1(0x19f6c60, 0xc000c0b020, 0xc000c0b020, 0x19f6c60, 0xc000c0b020, 0x1)
        /Users/ladeo/dev/arrai/rel/expr_dot.go:60 +0x593
github.com/arr-ai/arrai/rel.(*DotExpr).Eval(0xc000817940, 0xc000a29f40, 0x8, 0xc000e5e678, 0xc000a29ea0, 0x0, 0x0)
        /Users/ladeo/dev/arrai/rel/expr_dot.go:79 +0x976
github.com/arr-ai/arrai/rel.(*AttrExpr).Apply(0xc000e5e730, 0xc000a29f40, 0x8, 0x19f6c60, 0x1f5f1e0, 0xc000e5e7d8, 0x1f48bc0, 0xc000e5e728, 0xc000a29f40)
        /Users/ladeo/dev/arrai/rel/expr_tuple.go:54 +0x52
github.com/arr-ai/arrai/rel.(*TupleExpr).Eval(0xc000263a80, 0xc000a29f40, 0x8, 0x1, 0xc000a29f40, 0x8, 0x1)
        /Users/ladeo/dev/arrai/rel/expr_tuple.go:145 +0x116
...

Your Environment

$ arrai info
v128