[
https://issues.apache.org/jira/browse/ASTERIXDB-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404700#comment-15404700
]
Yingyi Bu commented on ASTERIXDB-1560:
--------------------------------------
In another extreme, if you define both datasets using *closed* types, then
you'll see SQL-92-compliant behaviors for implicit variable references:-)
CASE1: "user" is a field of GleambookUsers but not GleambookMessages, succeed;
CASE2: "user" is a field of GleambookMessages but not GleambookUsers, succeed;
CASE3: "user" is a field of GleambookMessages and also a field of
GleambookUsers, fail with the "ambiguous reference..." message;
CASE4: "user" is not a field of GleambookMessages nor a field of
GleambookUsers, fail with the "undefined identifier ...." message.
For your query which defines both dataset using *open* types, the error message
is consistent with the above CASE 3.
> Misleading SQL++ error message when variables are undefined
> ------------------------------------------------------------
>
> Key: ASTERIXDB-1560
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-1560
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: AsterixDB, Error Reporting
> Reporter: Michael J. Carey
> Assignee: Yingyi Bu
> Priority: Minor
>
> This query:
> SELECT u.name AS uname, m.message AS message
> FROM GleambookUsers u
> UNNEST GleambookMessages m
> WHERE m.authorId = user.id;
> Yields this error message:
> Cannot resolve ambiguous alias (variable) reference for identifier user
> [AlgebricksException]
> The reference is undefined, not ambiguous, in this case.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)