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

Michael J. Carey updated ASTERIXDB-1958:
----------------------------------------

In addition, doing this for an undefined nested field has (expectedly) similar 
issues, plus the syntax used in the error message is a little weird - it should 
maybe use the .-notation used in the CREATE INDEX statement instead.

FOR EXAMPLE:

CREATE INDEX gbUserSinceIdx on GleambookUsers(userSince.month.foo.bar);

==>  Unknown type [userSince, month, foo, bar] [AlgebricksException]


> Need better error message for CREATE INDEX on undefined fields
> --------------------------------------------------------------
>
>                 Key: ASTERIXDB-1958
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1958
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: *DB - AsterixDB, SQL - Translator SQL++
>         Environment: MacOS, latest snapshot of master
>            Reporter: Michael J. Carey
>            Assignee: Dmitry Lychagin
>
> THE OFFENDING ERROR MSG:
> Unknown type [userSince] [AlgebricksException]
> THE COMPLAINT:
> The error message is missing location info (e.g., line number) and should 
> indicate that userSince is a non-predeclared field in the data type of the 
> data set - and therefore its type also needs to be specified in order for 
> CREATE INDEX to work.  (See manual. :-) )
> THE REPRODUCER SETUP:
> DROP DATAVERSE TinySocial IF EXISTS;
>     CREATE DATAVERSE TinySocial;
>     USE TinySocial;
>     CREATE TYPE ChirpUserType AS {
>         screenName: string
>     };
>     CREATE TYPE ChirpMessageType AS closed {
>         chirpId: string
>     };
>     CREATE TYPE GleambookUserType AS {
>         id: int
>     };
>     CREATE TYPE GleambookMessageType AS {
>         messageId: int
>     };
>     CREATE DATASET GleambookUsers(GleambookUserType)
>         PRIMARY KEY id;
>     CREATE DATASET GleambookMessages(GleambookMessageType)
>         PRIMARY KEY messageId;
>     CREATE DATASET ChirpUsers(ChirpUserType)
>         PRIMARY KEY screenName;
>     CREATE DATASET ChirpMessages(ChirpMessageType)
>         PRIMARY KEY chirpId;
>     CREATE INDEX gbUserSinceIdx on GleambookUsers(userSince);



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to