Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive insert and ACID

Solved Go to solution

Hive insert and ACID

New 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

Accepted Solutions

Re: Hive insert and ACID

Expert Contributor

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> 
4 REPLIES 4

Re: Hive insert and ACID

Expert Contributor

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> 

Re: Hive insert and ACID

Thanks Eugene. I will remove my answer.

Re: Hive insert and ACID

New Contributor

Thanks @Eugene Koifman

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

Re: Hive insert and ACID

Expert Contributor

I fixed the wiki

Don't have an account?
Coming from Hortonworks? Activate your account here