Reputation: 91
As I know hive support sql like one from multi select, my sql like this:
FROM
(SELECT DISTINCT a.td_id,a.brd,a.crt_at,
b.imei
FROM table_main as a
LEFT JOIN
(SELECT DISTINCT imei,
td_id
FROM table_device
WHERE crt_at < '2016-12-01')b ON a.td_id=b.td_id)bb
SELECT imei,td_id,crt_at,brd
SELECT imei,
count(DISTINCT td_id)AS imei_cnt
GROUP BY imei
I try one query multi select, but hive return exception: "Error while compiling statement: FAILED: SemanticException Exception while processing"
Anyone know why this is happening? How to solve it? Thanks, Gal.
Upvotes: 0
Views: 4919
Reputation: 44981
There is no such thing as "multi select".
a query cannot return multiple row-sets.
Perhaps you are confusing it with "multiple inserts" -
Inserting multiple row-sets into multiple tables,from one source, in a single statement.
Upvotes: 1