Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> need help on writing hive query


+
qiaoresearcher 2012-11-03, 03:35
+
java8964 java8964 2012-11-03, 23:48
Copy link to this message
-
need help on writing hive query
Hi all,

here is the question. Assume we have a table like:
------------------------------------------------------------------------------------------------------------------------------
user_id    ||  user_visiting_time    ||      user_current_web_page     ||
 user_previous_web_page
user 1                 time (1,1)                                   page 1
                                      page 0
user 1                 time (1,2)                                   page 2
                                      page 1
user 1                 time (1,3 )                                  page 3
                                      page 2
.....                          ......
     ....                                                ....
user n                 time (n,1)                                   page 1
                                      page 0
user n                 time (n,2)                                   page 2
                                      page 1
user n                 time (n,3)                                   page 3
                                      page 2

that is, in each row, we know the current web page that user is viewing,
and we know the previous web page the user coming from

now we want to generate a list for each user that recorded the complete
path the user is taking:
i.e., how can we use hive to generate output like:
------------------------------------------------------------------------------------------------
user 1 :      page 1   page 2 page 3  page 4  .......... (till reach the
beginning page of user 1)
user 2:       page 1 page 2 page 3  page 4 page 5  .......  ( till reach
the beginning page of user 2)
the web pages viewed by user 1 and user 2 might be different.

can we generate this using hive?

thanks,
+
Philip Tromans 2012-10-31, 21:32
+
Tom Brown 2012-10-31, 21:37
+
Matt Tucker 2012-10-31, 21:53
+
java8964 java8964 2012-10-31, 23:08
+
Mark Grover 2012-10-31, 21:29
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB