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 Threaded View
Hive >> mail # user >> What's wrong with this query?


Copy link to this message
-
What's wrong with this query?
I wrote this query but everytime I get the below error.

    select * from (select t2.buyer_id, t2.item_id, t2.created_time as
created_time, subq.user_id, subq.product_id, subq.timestamps as timestamps
    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) subq INNER JOIN
testingtable1 t2 on t2.buyer_id = subq.user_id
    AND subq.timestamps = unix_timestamp(t2.created_time)
    WHERE (subq.product_id <> t2.item_id)
    union all
    select t2.buyer_id, t2.item_id as item_id, t2.created_time,
subq.user_id, subq.product_id as product_id, subq.timestamps
    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) subq INNER JOIN
testingtable1 t2 on t2.buyer_id = subq.user_id
        and subq.product_id = t2.item_id
        WHERE (subq.timestamps <> unix_timestamp(t2.created_time)))
unionall;

But I always get error as -

`*FAILED: Parse Error: line 3:184 mismatched input 'INNER' expecting ) in
subquery source`*
*Raihan Jamal*
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