Can we Insert data in Hive Table?

Most individuals erroneously believe that DML statements are not supported by Hive. This is a result of the out-of-date information on the internet. DML commands like INSERT, UPDATE, and DELETE are supported by Hive.

To answer the question, the answer is yes, we can add data to Hive. For more details, please see the following blog postings.

Examples from the links:

INSERT INTO TABLE tblSales VALUES
(20981,’Hisense Television’, 7, 14000),
(20982,’Sony Television’, 4, 12000);

INSERT INTO TABLE tblSales PARTITION (SoldDate = ‘2021-08-07’) VALUES
(20981,’Hisense Television’, 7, 14000),
(20982,’Sony Television’, 4, 12000);

Hive> FROM PersonsData
INSERT INTO tbCustomers
SELECT  ID, Name, City, EmailID, Phone, Work WHERE work=’Customer’

INSERT INTO tbAgents
SELECT  ID, Name, City, EmailID, Phone, Work WHERE work=’Agent’

INSERT INTO tbSuppliers
SELECT  ID, Name, City, EmailID, Phone, Work WHERE work=’Supplier’;

Happy learning!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s