0

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.

1 Answer 1

1

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.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingdataintoHiveTablesfromqueries

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.