You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Till Westmann (Jira)" <ji...@apache.org> on 2020/11/24 00:39:03 UTC

[jira] [Updated] (ASTERIXDB-2595) Positional vars and array indexes are inconsistent in SQL++

     [ https://issues.apache.org/jira/browse/ASTERIXDB-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Till Westmann updated ASTERIXDB-2595:
-------------------------------------
    Fix Version/s:     (was: 0.9.5)
                   0.9.6

> Positional vars and array indexes are inconsistent in SQL++
> -----------------------------------------------------------
>
>                 Key: ASTERIXDB-2595
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2595
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: *DB - AsterixDB, SQL - Translator SQL++
>    Affects Versions: 0.9.4.1
>            Reporter: Michael J. Carey
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.6
>
>
> Positional variables in SQL++ seem to start at 1 -- while array indexes start at 0 -- this is pretty annoying in a use case like:
> CREATE FUNCTION grade(score)  {
> LET stdcutoffs = [96.5, 93.5, 90.0, 86.5, 83.5, 80.0, 76.5, 73.5, 70.0, 66.5, 63.5, 60.0, 0.0],
>             grades  = [“A+“, “A”, “A-“, “B+“, “B”, “B-“, “C+“, “C”, “C-“, “D+“, “D”, “D-“, “F”]
> FROM grades AS g AT i
> WHERE score >= stdcutoffs[i-1]
> SELECT VALUE g
> ORDER BY i ASC
> LIMIT 1
> };



--
This message was sent by Atlassian Jira
(v8.3.4#803005)