HIVE CRUD Operation

4 comments

If you want to perform Hive CRUD using ACID operations, you need check whether you have
hive 0.14 version or not

In order to perform CREATE, SELECT, UPDATE, DELETE, We have to ensure while creating the table with the following conditions

  • File format should be in ORC file format with   TBLPROPERTIES(‘transactional’=’true’)
  • Table should be CLUSTERED BY   with some Buckets, please refer the below CREATE TABLE statement.

How to Check Hive Version?

[email protected]:~$ hive  –version
Hive 0.14.0.2.2.0.0-2041

HIVE CREATE TABLE

Let us CREATE ORC table with following fields Values

 

HIVE INSERT INTO TABLE

Here let us see how to INSERT rows Manually into Newly Created STUDENT Table.

use the following Hiveql to insert the data into STUDENT table.

 

 

HIVE SELECT

Let us select all the rows from STUDENT table.

HIVE UPDATE

Let us try to update student id from 105 to 110 using UPDATE.

Let us check the above HIVE Update command has updated correctly using HIVE SELECT command.

HIVE DELETE FROM TABLE

Let us delete the row where STD_ID =110.

Let us try to delete all the Rows from STUDENT Table

Let us check whether all the values are removed or not .

The DELETE statement has removed all the rows successfully.

 

Leave a comment

Your email address will not be published. Required fields are marked *

4 thoughts on “HIVE CRUD Operation”