Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter() after pivot() causes panic runtime error #15762

Closed
alespour opened this issue Nov 5, 2019 · 3 comments
Closed

filter() after pivot() causes panic runtime error #15762

alespour opened this issue Nov 5, 2019 · 3 comments

Comments

@alespour
Copy link
Contributor

alespour commented Nov 5, 2019

When I add filter() after pivot(), it panics. I am trying to filter out rows based on combination of several columns values, but it panics even with the simple column value filter (even if I use r._measurement equals check to filter). I am running InfluxDB alpha 19 linux version.

Without filter():

> from(bucket: "nyc") |> range(start: -1w) |> filter(fn: (r) => r._measurement == "taxi") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
Result: _result
Table: keys: [_start, _stop, _measurement, pt]
                   _start:time                      _stop:time     _measurement:string               pt:string                      _time:time                    dist:float                     lat:float          geohash:string                     tip:float                     lon:float  
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------  ----------------------------  ----------------------  ----------------------------  ----------------------------  
2019-10-29T11:55:27.453925243Z  2019-11-05T11:55:27.453925243Z                    taxi                 dropoff  2019-11-01T00:11:55.082153551Z                           1.2                     40.753944               dr5ru708u                             0                    -73.992035  
Table: keys: [_start, _stop, _measurement, pt]
                   _start:time                      _stop:time     _measurement:string               pt:string                      _time:time                     lat:float                     lon:float          geohash:string  
------------------------------  ------------------------------  ----------------------  ----------------------  ------------------------------  ----------------------------  ----------------------------  ----------------------  
2019-10-29T11:55:27.453925243Z  2019-11-05T11:55:27.453925243Z                    taxi                  pickup  2019-11-01T00:00:01.947779410Z                     40.744614                    -73.979424               dr5ru93fd  

With filter()

> from(bucket: "nyc") |> range(start: -1w) |> filter(fn: (r) => r._measurement == "taxi") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> filter(fn: (r) => r.geohash == "dr5ru93fd")
Error: panic: runtime error: invalid memory address or nil pointer dereference

line protocol sample input

@alespour
Copy link
Contributor Author

alespour commented Nov 7, 2019

Stacktrace:

2019-11-07T09:04:12.934646Z	info	Dispatcher panic	{"log_id": "0IwyT5mG000", "service": "storage-reads", "component": "dispatcher", "error": "panic: runtime error: invalid memory address or nil pointer dereference"}
goroutine 93644 [running]:
runtime/debug.Stack(0xc0237fcc00, 0x284b100, 0x1b57447)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/influxdata/flux/execute.(*poolDispatcher).Start.func1.1(0xc0237fcc60)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/dispatcher.go:81 +0x196
panic(0x18a6fe0, 0x3d368d0)
	/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/influxdata/flux/compiler.(*compilerScope).LocalRange(0xc00ed82a20, 0xc00ef598d0)
	<autogenerated>:1 +0x32
github.com/influxdata/flux/values.BuildExternAssignments(0x288ecc0, 0xc001992fa0, 0x7f5ac16d2628, 0xc00ed82a20, 0xc00ed82a20, 0x1b784ac)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/values/scope.go:193 +0x50
github.com/influxdata/flux/compiler.Compile(0x28b0ac0, 0xc00ed82a20, 0xc001992fa0, 0x289fae0, 0xc00f0ca0b8, 0x186b880, 0xc000af7f20, 0xc0008f0c60, 0xc0008f0c60)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/compiler/compiler.go:21 +0x254
github.com/influxdata/flux/compiler.(*CompilationCache).Compile(0xc012f0d780, 0x289fae0, 0xc00f0ca0b8, 0x1, 0xc0008f0ce8, 0x0, 0x0)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/compiler/compiler.go:421 +0xc8
github.com/influxdata/flux/execute.(*dynamicFn).prepare(0xc0237fcd20, 0xc01eaaa180, 0x9, 0x10, 0xc000af7f20, 0x0, 0x203003)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/row_fn.go:57 +0x2d6
github.com/influxdata/flux/execute.(*RowPredicateFn).Prepare(0xc0237fcd20, 0xc01eaaa180, 0x9, 0x10, 0x20, 0x20)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/row_fn.go:191 +0x58
github.com/influxdata/flux/stdlib/universe.(*filterTransformation).Process(0xc0176a37d0, 0xda5d0f6b341b275a, 0x81a13ee6cc441081, 0x288e5c0, 0xc013bb2370, 0x0, 0x0)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/stdlib/universe/filter.go:153 +0x8d
github.com/influxdata/flux/execute.processMessage(0x288fd00, 0xc0176a37d0, 0x2866fc0, 0xc00f0c7ae0, 0x0, 0x0, 0xc0237fcb40)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/transport.go:199 +0x1e4
github.com/influxdata/flux/execute.(*consecutiveTransport).processMessages(0xc0237fcd80, 0xa)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/transport.go:156 +0xa1
github.com/influxdata/flux/execute.(*poolDispatcher).run(0xc0237fcc60, 0x2887d00, 0xc000146ab0)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/dispatcher.go:132 +0x4b
github.com/influxdata/flux/execute.(*poolDispatcher).Start.func1(0xc0237fcc60, 0x2887d00, 0xc000146ab0)
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/dispatcher.go:86 +0x95
created by github.com/influxdata/flux/execute.(*poolDispatcher).Start
	/go/pkg/mod/github.com/influxdata/flux@v0.52.0/execute/dispatcher.go:63 +0x7e

@alespour
Copy link
Contributor Author

Same error occurs when map() is used in pipe after pivot().

@alespour
Copy link
Contributor Author

Transferred to Flux issue #2288.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant