hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Techy Teck <comptechge...@gmail.com>
Subject Running the HiveQL from the shell prompt.
Date Wed, 08 Aug 2012 02:46:16 GMT
This is my below HiveQL query that I am running from the shell prompt. The
only confusion that I am having with this is, If you see double quotes
before first SELECT in red color, it gets closed on the red color *#. *So
should I escape the *# *character or it will be running fine like this
also?



hive -e *"*SELECT user_id
,product_id
,prod_and_ts_split
 FROM (
SELECT *
FROM (
 SELECT user_id
,prod_and_ts.product_id AS product_id
,prod_and_ts.timestamps AS timestamps
 FROM testingtable2 LATERAL VIEW explode(purchased_item) exploded_table AS
prod_and_ts where user_id is NOT NULL
) prod_and_ts
 ) tt2 LATERAL VIEW explode(split(timestamps, *"#"*)) exploded_table2 AS
prod_and_ts_split
WHERE to_date(from_unixtime(cast(prod_and_ts_split AS BIGINT))) =
'2012-07-12'
 GROUP BY user_id
,product_id
,prod_and_ts_split
 ORDER BY user_id
,prod_and_ts_split DESC"

Mime
View raw message