[ 
https://issues.apache.org/jira/browse/ASTERIXDB-2390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16484459#comment-16484459
 ] 

Taewoo Kim edited comment on ASTERIXDB-2390 at 5/22/18 7:36 PM:
----------------------------------------------------------------

I just checked the appendiex_3 and I am still confused. What do you mean by "t 
is not in scope after the GROUP BY"? You mean operators after the GROUP BY or 
literally means XXX in "GROUP BY XXX"? 

Could you revise the first SQLPP query to make it work using an alias? Even if 
I don't use `t`, it generates a similar error.


was (Author: wangsaeu):
I just checked the appendiex_3 and I am still confused. What do you mean by "t 
is not in scope after the GROUP BY"? You mean operators after the GROUP BY or 
literally means XXX in "GROUP BY XXX"? 

Could you revise the first SQLPP query to make it work using an alias? Even if 
I don't use `t`, it generates a similar error

> 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
>            Priority: Major
>
> 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)

Reply via email to