0
$\begingroup$

I am wondering if there is a way to proceed 2 exectuions in 1 step in hive. For example:

SELECT * FROM TABLE1
SELECT * FROM TABLE2
;

Do this in one window, and do not have to open 2 hive windows to execute each line separetly.

Can it be done on HUE?

$\endgroup$
2
$\begingroup$

You can use HiveCLI Tool to run HiveQL with a given sql file.

$HIVE_HOME/bin/hive -f /home/my/hive-script.sql

Please see official document: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli

What you need to do is to

  1. Put your HiveQLs in a file as below
    SELECT * FROM TABLE1; SELECT * FROM TABLE2;

  2. Use HiveCLI and run with above file

$\endgroup$
1
  • $\begingroup$ Is it possible to do this using HUE? $\endgroup$ Feb 1 '15 at 18:36
2
$\begingroup$

Yes, you can execute multiple HQL's using Hue as long as each individual HQL is separated by a semi colon (;)

$\endgroup$
1
  • $\begingroup$ Looks like it does not work somehow on mine Hue.. Probably I have mb older version or something $\endgroup$ Feb 3 '15 at 17:39
1
$\begingroup$

You can separate each query with a semi colon (;)

select column1 from table1;
select column2 from table2;

This command can be executed from command line via inline queries or a file. Usage of Hive CLI is not recommended. You must use beeline to execute queries configured via hive server 2 so that all/any underlying security control measures are honored.

you may invoke beeline with the command:

beeline
$\endgroup$
1
  • $\begingroup$ Is it possible to do this using HUE? $\endgroup$ Feb 1 '15 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.