Labels

Wednesday, March 23, 2022

How to execute SQL script through Hive? (Class -15)

The Hive scripts are used to collectively execute a series of SQL Commands. In other words, multiple SQL statements can be grouped and executed all at once. This helps to reduce the time and effort expended in manually drafting and executing any command.

 Hive supports scripting from versions of Hive 0.10.0 and beyond.

 Steps need to follow such as:

a)      Create a Database à create db name;

b)     Create a table

c)       Load the data

d)      Select the data

We need to do above steps in script.


Go to Cloudera / Cloudxlab:         

 Develop the HQL script.


Create file à Vi req_b10.hql (below data insert in this file)


Run on Hive




Input data in Shell Script file:


Now Execute Shell Script:




No comments:

Post a Comment