Support Questions

Find answers, ask questions, and share your expertise

Hive insert and ACID

avatar
Contributor

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.

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Insertingvalue...

Can you please explain this behavior ?

Thanks

1 ACCEPTED SOLUTION

avatar
Super Collaborator

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> 

View solution in original post

4 REPLIES 4

avatar
Super Collaborator

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> 

avatar

Thanks Eugene. I will remove my answer.

avatar
Contributor

Thanks @Eugene Koifman

Can you point to an updated complete and updated documentation/book on Hive features ? (ACID, LLAP, etc)

avatar
Super Collaborator

I fixed the wiki