Open jjbrosnan opened 1 year ago
With update_by and rolling group, we support negative indexes, and it seems that each Vector.get's implementation could test for negative values, or perhaps the query parser itself could identify negative literals (which means you couldn't use another variable/column to contain the index).
As a user, it would be nice to have the option of using negative array indices to grab data near the end of an array or vector in the query language. Right now, you have to do
vec.get(vec.size() - n)
(orvec.length()
) to get the nth last element of an array/vector. It would be nice to enable negative indices like in Python:vec[-1]
to get the last element of an array/list.Even if it doesn't use the square brackets, maybe an array/vector method like
getVal
, which can take negative indices.