goccy/go-zetasqlite

[Arrays] Ordinal indexing does not properly handle last-element ordinal

ohaibbq opened this issue · 0 comments

WITH toks AS (SELECT ['one', 'two'] AS digits)
SELECT digits[SAFE_ORDINAL(2)], digits[ORDINAL(2)], digits[OFFSET(1)], digits[SAFE_OFFSET(1)] FROM toks

Expected

col1 col2 col3 col4
two two two two

Actual

col1 col2 col3 col4
null ERROR ORDINAL(2) is out of range two two