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

[Windowing] Crash when a window partition has null-value #139

Open
ohaibbq opened this issue Jan 28, 2024 · 0 comments
Open

[Windowing] Crash when a window partition has null-value #139

ohaibbq opened this issue Jan 28, 2024 · 0 comments

Comments

@ohaibbq
Copy link
Contributor

ohaibbq commented Jan 28, 2024

WITH finishers AS
 (SELECT 'Sophia Liu' as name,
  TIMESTAMP '2016-10-18 2:51:45+00' as finish_time,
  'F30-34' as division
  UNION ALL SELECT 'Nilly Nada', TIMESTAMP '2016-10-18 3:10:14+00', null)
SELECT name,
  FORMAT_TIMESTAMP('%X', finish_time) AS finish_time,
  division,
  LEAD(name, 2, 'Nobody')
    OVER (PARTITION BY division ORDER BY finish_time ASC) AS two_runners_back
FROM finishers
--- FAIL: TestQuery (0.01s)
    --- FAIL: TestQuery/lead_with_default (0.01s)
panic: interface conversion: interface is nil, not internal.Value [recovered]
	panic: interface conversion: interface is nil, not internal.Value

goroutine 6 [running]:
testing.tRunner.func1.2({0x1021e0de0, 0xc0006acff0})
	/usr/local/Cellar/go/1.21.6/libexec/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
	/usr/local/Cellar/go/1.21.6/libexec/src/testing/testing.go:1548 +0x397
panic({0x1021e0de0?, 0xc0006acff0?})
	/usr/local/Cellar/go/1.21.6/libexec/src/runtime/panic.go:914 +0x21f
github.com/goccy/go-zetasqlite/internal.parseWindowOptions({0xc0003eb680, 0x7, 0xc0006ac8a0?})
	/Users/danhansen/go/github.com/Recidiviz/go-zetasqlite/internal/function_window_option.go:317 +0x4d9
github.com/goccy/go-zetasqlite/internal.(*WindowAggregator).Step(0xc0006ac810, {0xc0003eb380?, 0x1?, 0x100073373?})
	/Users/danhansen/go/github.com/Recidiviz/go-zetasqlite/internal/function_bind.go:139 +0x53
reflect.Value.call({0x1021e4c60?, 0xc0006ac810?, 0x1?}, {0x1023b934f, 0x4}, {0xc0001eee40, 0x8, 0x1026948e8?})
	/usr/local/Cellar/go/1.21.6/libexec/src/reflect/value.go:596 +0xce7
reflect.Value.Call({0x1021e4c60?, 0xc0006ac810?, 0x8?}, {0xc0001eee40?, 0x0?, 0x1021cddc0?})
	/usr/local/Cellar/go/1.21.6/libexec/src/reflect/value.go:380 +0xb9
github.com/mattn/go-sqlite3.(*aggInfo).Step(0xc000708c80, 0xc000001bc0?, {0x60000376c660, 0x8, 0x8})
	/Users/danhansen/go/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3.go:466 +0xde
github.com/mattn/go-sqlite3.stepTrampoline(0x1052bea68?, 0xd745?, 0x60000376c660)
	/Users/danhansen/go/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/callback.go:46 +0x6b
github.com/mattn/go-sqlite3._Cfunc__sqlite3_step_internal(0x7faccb404d10)
	_cgo_gotypes.go:366 +0x47
github.com/mattn/go-sqlite3.(*SQLiteRows).nextSyncLocked.func1(0x10001e708?)
	/Users/danhansen/go/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3.go:2186 +0x45
github.com/mattn/go-sqlite3.(*SQLiteRows).nextSyncLocked(0xc000112360, {0xc000034940, 0x4, 0xc0000bda68?})
	/Users/danhansen/go/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3.go:2186 +0x37
github.com/mattn/go-sqlite3.(*SQLiteRows).Next(0xc000112360, {0xc000034940?, 0x4, 0x4})
	/Users/danhansen/go/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3.go:2163 +0x2c8
database/sql.(*Rows).nextLocked(0xc0000ee3f0)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:3019 +0x107
database/sql.(*Rows).Next.func1()
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:2994 +0x29
database/sql.withLock({0x10267aad0, 0xc0000ee428}, 0xc0000bdb88)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:3502 +0x82
database/sql.(*Rows).Next(0xc0000ee3f0)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:2993 +0x85
github.com/goccy/go-zetasqlite/internal.(*Rows).Next(0xc0000347c0, {0xc0000348c0, 0x4, 0x4})
	/Users/danhansen/go/github.com/Recidiviz/go-zetasqlite/internal/rows.go:73 +0x59
database/sql.(*Rows).nextLocked(0xc0000ee480)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:3019 +0x107
database/sql.(*Rows).Next.func1()
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:2994 +0x29
database/sql.withLock({0x10267aad0, 0xc0000ee4b8}, 0xc0000bddb8)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:3502 +0x82
database/sql.(*Rows).Next(0xc0000ee480)
	/usr/local/Cellar/go/1.21.6/libexec/src/database/sql/sql.go:2993 +0x85
github.com/goccy/go-zetasqlite_test.TestQuery.func2(0xc000502340)
	/Users/danhansen/go/github.com/Recidiviz/go-zetasqlite/query_test.go:5120 +0x294
testing.tRunner(0xc000502340, 0xc0000ee1b0)
	/usr/local/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 27
	/usr/local/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x3ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant