You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Taewoo Kim (JIRA)" <ji...@apache.org> on 2018/05/21 21:24:00 UTC

[jira] [Created] (ASTERIXDB-2390) Cannot resolve ambiguous alias reference

Taewoo Kim created ASTERIXDB-2390:
-------------------------------------

             Summary: Cannot resolve ambiguous alias reference
                 Key: ASTERIXDB-2390
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2390
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Taewoo Kim


The following query generates a CompilationException.
{code:java}
drop dataverse twitter if exists;
create dataverse twitter if not exists;
use twitter;

create type typeUser if not exists as open {
id: int64,
name: string,
screen_name : string,
profile_image_url : string,
lang : string,
location: string,
create_at: date,
description: string,
followers_count: int32,
friends_count: int32,
statues_count: int64
};

create type typePlace if not exists as open{
country : string,
country_code : string,
full_name : string,
id : string,
name : string,
place_type : string,
bounding_box : rectangle
};

create type typeGeoTag if not exists as open {
stateID: int32,
stateName: string,
countyID: int32,
countyName: string,
cityID: int32?,
cityName: string?
};

create type typeTweet if not exists as open {
create_at : datetime,
id: int64,
text: string,
in_reply_to_status : int64,
in_reply_to_user : int64,
favorite_count : int64,
coordinate: point?,
retweet_count : int64,
lang : string,
is_retweet: boolean,
hashtags : {{ string }} ?,
user_mentions : {{ int64 }} ? ,
user : typeUser,
place : typePlace?,
geo_tag: typeGeoTag
};

create dataset ds_tweet(typeTweet) if not exists primary key id with filter on create_at with {"merge-policy":{"name":"prefix","parameters":{"max-mergable-component-size":536870912, "max-tolerance-component-count":5}}};

create index text_idx if not exists on ds_tweet(text) type fulltext;{code}
 

Query:
{code:java}
USE twitter;
SELECT spatial_cell(get_points(t.place.bounding_box)[0], create_point(0.0,0.0),1.0,1.0) AS cell, count(*) AS cnt FROM ds_tweet t
WHERE ftcontains(t.text, ['rain'], {'mode':'any'}) AND t.place.bounding_box IS NOT unknown 
AND t.create_at >= datetime('2017-02-25T00:00:00') AND t.create_at < datetime('2017-02-26T00:00:00') 
GROUP BY cell;{code}
 

Exception:
{code:java}
Cannot resolve ambiguous alias reference for undefined identifier t in [#1, $cell] [CompilationException]
{code}
 

The same query that doesn't generate an exception:
{code:java}
USE twitter;
SELECT spatial_cell(get_points(t.place.bounding_box)[0], create_point(0.0,0.0),1.0,1.0), count(*) AS cnt FROM ds_tweet t
WHERE ftcontains(t.text, ['rain'], {'mode':'any'}) AND t.place.bounding_box IS NOT unknown 
AND t.create_at >= datetime('2017-02-25T00:00:00') AND t.create_at < datetime('2017-02-26T00:00:00') 
GROUP BY spatial_cell(get_points(t.place.bounding_box)[0], create_point(0.0,0.0),1.0,1.0);
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)