Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

output/echo a meesage in hql/ hive query language

Tags:

hadoop

hive

I need to create a hive.hql as follows.

HIVE.hql:

select * from tabel1;
select * from table2;

My question is: can i echo any message to my console like " results from table1 is obtained " in the hql code after table one is created like

select * from tabel1;
echo/print/output ("table 1 results obtained");
select * from table2;
like image 667
Akhil R'Meda Avatar asked Feb 24 '15 18:02

Akhil R'Meda


People also ask

How do you write output to a file in hive?

Just give the path to your directory. The correct method is shown below. $ insert overwrite directory '/home/output' select books from table; Also, note that the insert overwrites directory basically removes all the existing files under the specified folder and then create data files as part files.

What is Hql in hive?

HQL or Hive Query Language is a simple yet powerful SQL like querying language which provides the users with the ability to perform data analytics on big datasets.

Which query language is used in hive?

Hive queries are written in HiveQL, which is a query language similar to SQL. Hive allows you to project structure on largely unstructured data. After you define the structure, you can use HiveQL to query the data without knowledge of Java or MapReduce.

Is hive and Hql same?

What is HQL? Hive defines a simple SQL-like query language to querying and managing large datasets called Hive-QL ( HQL ). It's easy to use if you're familiar with SQL Language. Hive allows programmers who are familiar with the language to write the custom MapReduce framework to perform more sophisticated analysis.


1 Answers

In the *.hql file insert a line as below in between the two hive queries.

!echo "table 1 results obtained"; 
like image 167
bkd Avatar answered Oct 05 '22 01:10

bkd