I am using Hive version 0.13.1. While trying to insert data into an existing table getting an error while using the below query:
CREATE TABLE table1 (order_num int, payment_type varchar(20), category varchar(20));
INSERT INTO TABLE table1 VALUES (151, 'cash', 'lunch');
ERROR :
ParseException line 1:25 cannot recognize input near 'VALUES' '(' '151' in select clause
While searching, got everyone suggesting above query, but unfortunately it's not working for me. Is it due to different Hive version?
I am getting this ambiguity due to link here
Needs help to insert data to an existing table in Hive.
An insert values statement isn't available in Hive until version .14, so you will need to change your syntax to do a insert select statement.
If you want to insert multiple values then you can union selects