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] ORDER BY .. NULLS FIRST / LAST not implemented #152

Open
ohaibbq opened this issue Feb 1, 2024 · 1 comment
Open

[Windowing] ORDER BY .. NULLS FIRST / LAST not implemented #152

ohaibbq opened this issue Feb 1, 2024 · 1 comment

Comments

@ohaibbq
Copy link
Contributor

ohaibbq commented Feb 1, 2024

WITH toks AS (
  SELECT DATETIME "2024-01-07 00:00:00" as dt
  UNION ALL SELECT DATETIME "2024-01-01 00:00:00"
  UNION ALL SELECT null
)
SELECT dt,
ROW_NUMBER() OVER (ORDER BY dt DESC NULLS FIRST),
ROW_NUMBER() OVER (ORDER BY dt DESC NULLS LAST)
FROM toks

Expected

dt rn1 rn2
2024-01-07 00:00:00 2 1
2024-01-01 00:00:00 3 2
null 1 3

Actual

dt rn1 rn2
2024-01-07 00:00:00 2 2
2024-01-01 00:00:00 3 3
null 1 1
@ohaibbq ohaibbq changed the title [Windowing] ORDER BY .. NULLS FIRST /. LAST not implemented [Windowing] ORDER BY .. NULLS FIRST /.LAST not implemented Feb 1, 2024
@ohaibbq ohaibbq changed the title [Windowing] ORDER BY .. NULLS FIRST /.LAST not implemented [Windowing] ORDER BY .. NULLS FIRST / LAST not implemented Feb 1, 2024
@ohaibbq
Copy link
Contributor Author

ohaibbq commented Feb 1, 2024

Null ordering can be added to the parser here https://github.com/goccy/go-zetasqlite/blob/main/internal/formatter.go#L1055-L1058 via item.NullOrder()

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

No branches or pull requests

1 participant