Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive, mail # user - question about hive SQL


Copy link to this message
-
question about hive SQL
ch huang 2013-08-19, 09:04
hi,all:
       i do not very familar with HQL, and my problem is ,now i have 2
queries
Q1: select page_url, original_category,token from media_visit_info group by
page_url, original_category,token limit 10

Q2:  select original_category as code , weight from media_visit_info where
page_url='X' group by original_category,weight;

Q1  page_url value should be send to Q2 where condition ,and the two query
result should be combined like

{

url:http\\:www.baidu.com,

category:|CN10,

token:20,

categorys:

[

{code:|CN10-1-1,weight:0.5},

{code:|CN11-2-2,weight:0.1},

{code:|CN10-1-3,weight:0.02}

]

}

i do not know if it can write into one query(JOIN+SUBQUERY??) ,any one can
help?
+
Sanjay Subramanian 2013-08-19, 18:50
+
EdwardKing 2014-04-22, 02:27