2016-07-29 4 views
0
id      bigint     from deserializer 
created_at    string     from deserializer 
source     string     from deserializer 
favorited    boolean     from deserializer 
retweeted_status  struct<text:string,user:struct<screen_name:string,name:string>,retweet_count:int> from deserializer 
entities    struct<urls:array<struct<expanded_url:string>>,user_mentions:array<struct<screen_name:string,name:string>>,hashtags:array<struct<text:string>>> from deserializer 
text     string     from deserializer 
user     struct<screen_name:string,name:string,friends_count:int,followers_count:int,statuses_count:int,verified:boolean,utc_offset:int,time_zone:string,location:string> from deserializer 
in_reply_to_screen_name string     from deserializer 

.하이브 쿼리가 예상대로 작동하지 않습니다.

select id from election order by election.retweeted_status.retweet_count desc limit 10 

이 쿼리는 를 오류가 "SemanticException [오류 10002] : 라인 1시 53분 잘못된 열 참조 'retweeted_status'"입니다 작동하지 않습니다

select * from election order by election.retweeted_status.retweet_count desc limit 10 

하지만이 쿼리는

+0

2 센트 : '선택'에없는 항목을 '주문'할 수 없습니다. –

+0

BTW, 어리석은 태그 "mysql-logic"의 핵심은 무엇입니까? MySQL에 "논리"가 있다고 가정해도 여기서 ** Hive ** 쿼리를 실행하고 있습니다. –

+0

어쩌면 질문에 레이블을 지정해야합니다. * 데이터베이스가 예상대로 작동하지 않습니다. * ... –

답변

0

을하고있다 쿼리는 아래의 순서로 실행됩니다.

1 FROM 절

2 WHERE 절

4 HAVING 절

5 SELECT 절 절 BY

6 ORDER BY 절

3 GROUP

7 제한

우리가 이후에 주문 실행하면서 select 절에서 결과를 얻었습니다. select 절에서 column을 선택하지 않았으므로 orderby 절은 fi 할 수 없습니다. 조작을 수행하려면 열 참조를 찾으십시오.

+0

예. sandeep 감사합니다. :) 이제 작동 중입니다. – rUCHIt

관련 문제