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

Cannot UNNEST null array fields #179

Closed
ohaibbq opened this issue Feb 27, 2024 · 0 comments · Fixed by #181
Closed

Cannot UNNEST null array fields #179

ohaibbq opened this issue Feb 27, 2024 · 0 comments · Fixed by #181

Comments

@ohaibbq
Copy link
Contributor

ohaibbq commented Feb 27, 2024

WITH file AS (
  SELECT 1 AS file_id, ARRAY<STRING>["r", "w"] AS modes
  UNION ALL SELECT 2, ARRAY<STRING>["w"]
)
SELECT id,
(SELECT mode FROM UNNEST(modes) AS mode WHERE mode = 'w') IS NOT NULL AS write_mode,
(SELECT mode FROM UNNEST(modes) AS mode WHERE mode = 'r') IS NOT NULL AS read_mode
FROM UNNEST([1, 2, 3]) id
LEFT JOIN file on file.file_id = id

Expected

id write_mode read_mode
1 true true
2 true false
3 false false

Actual

id write_mode read_mode
1 true true
2 true false
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x100ee1d94]
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