Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 01-27-2017 05:03 PM - edited 09-16-2022 03:58 AM
Hi,
I created a simple Hive table (everything default) and were surprised that I could insert data into it doing INSERT INTO TABLE etc.
The Hive manual claims that insert is available only for tables that support ACID. However, I didn't set anything to enable ACID support for my table. Also, data is not in ORC.
Can you please explain this behavior ?
Thanks
Created 01-27-2017 05:30 PM
That doc link is wrong. VALUES clause works with any table.
hive> create table T(a int, b int);
OK
Time taken: 0.326 seconds
hive> insert into T values(1,2),(3,4);
Query ID = cstm-hdfs_20170127172630_99a0bfa1-6f10-427b-aed1-fd0648f02f73
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1485331877667_0022)
--------------------------------------------------------------------------------
VERTICES STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
--------------------------------------------------------------------------------
Map 1 .......... SUCCEEDED 1 1 0 0 0 0
--------------------------------------------------------------------------------
VERTICES: 01/01 [==========================>>] 100% ELAPSED TIME: 7.62 s
--------------------------------------------------------------------------------
Loading data to table tpch.t
Table tpch.t stats: [numFiles=1, numRows=2, totalSize=8, rawDataSize=6]
OK
Time taken: 9.487 seconds
hive> select * from T;
OK
1 2
3 4
Time taken: 0.232 seconds, Fetched: 2 row(s)
hive>
Created 01-27-2017 05:30 PM
That doc link is wrong. VALUES clause works with any table.
hive> create table T(a int, b int);
OK
Time taken: 0.326 seconds
hive> insert into T values(1,2),(3,4);
Query ID = cstm-hdfs_20170127172630_99a0bfa1-6f10-427b-aed1-fd0648f02f73
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1485331877667_0022)
--------------------------------------------------------------------------------
VERTICES STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
--------------------------------------------------------------------------------
Map 1 .......... SUCCEEDED 1 1 0 0 0 0
--------------------------------------------------------------------------------
VERTICES: 01/01 [==========================>>] 100% ELAPSED TIME: 7.62 s
--------------------------------------------------------------------------------
Loading data to table tpch.t
Table tpch.t stats: [numFiles=1, numRows=2, totalSize=8, rawDataSize=6]
OK
Time taken: 9.487 seconds
hive> select * from T;
OK
1 2
3 4
Time taken: 0.232 seconds, Fetched: 2 row(s)
hive>
Created 01-27-2017 05:38 PM
Thanks Eugene. I will remove my answer.
Created 01-27-2017 05:45 PM
Thanks @Eugene Koifman
Can you point to an updated complete and updated documentation/book on Hive features ? (ACID, LLAP, etc)
Created 01-27-2017 05:40 PM
I fixed the wiki