Details
-
Bug
-
Resolution: Fixed
-
Minor
-
5.5.0, 6.0.0
-
Untriaged
-
Unknown
-
CX Sprint 107, CX Sprint 108, CX Sprint 109, CX Sprint 110, CX Sprint 111
Description
The following (broken) SQL++ query:
USE hw5;
FROM world AS x,
x.mondial.country AS z,
{{ x.mondial.mountain AS y }}
GROUP BY z.name
SELECT z.`-car_code` AS country_code,
z.name AS country_name,
y.name AS mountain, y.height AS height;
Gives this very confusing error message:
"Cannot resolve ambiguous alias reference for undefined identifier z in [#1, $name][CompilationException]"
This is confusing in multiple ways:
1. What the heck is #1? And ditto for $name?
2. What is the meaning of the use of the array constructor in the error message? () Note that these users are making heavy use of array constructor syntax, so [ ]'s are common in their queries - we shouldn't use it in our error messages ever unless we're complaining about the user's array constructors IMO.
3. What line is the error on - is this before or after the GROUP BY? (It's after.)
4. "I defined z, so why is it undefined?" (Asked the user. )
For setup, do this:
DROP DATAVERSE hw5 IF EXISTS;
CREATE DATAVERSE hw5;
USE hw5;
CREATE TYPE worldType AS {auto_id:uuid };
CREATE DATASET world(worldType) PRIMARY KEY auto_id AUTOGENERATED;