# How to proceed 2 executions in 1 step in hive?

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?

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

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

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

• Is it possible to do this using HUE? Feb 1, 2015 at 18:36

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

• Looks like it does not work somehow on mine Hue.. Probably I have mb older version or something Feb 3, 2015 at 17:39

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

• Is it possible to do this using HUE? Feb 1, 2015 at 18:35