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

Arrays should be indexable from the end too #2974

Closed
rmoff opened this issue Jun 13, 2019 · 0 comments · Fixed by #3004
Closed

Arrays should be indexable from the end too #2974

rmoff opened this issue Jun 13, 2019 · 0 comments · Fixed by #3004

Comments

@rmoff
Copy link
Contributor

rmoff commented Jun 13, 2019

I want to be able to access the last element(s) in an array.

KSQL support accessing elements based on offset from the start:

ksql> SELECT SCHEDULE_SEGMENT_LOCATION[0] FROM SCHEDULE_01 LIMIT 1;
{"record_identity":"LO","engineering_allowance":"3","line":"AL","public_departure":"0506","tiploc_code":"YORK","departure":"0508","location_type":"LO","platform":"9"}
Limit Reached
Query terminated

But not the end:

ksql> SELECT SCHEDULE_SEGMENT_LOCATION[-1] FROM SCHEDULE_01 LIMIT 1;
null
Limit Reached
Query terminated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant