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.

Update and Delete are not working in Hive ?

Highlighted

Update and Delete are not working in Hive ?

Contributor

Hi all,

 

I am not able to delete or update in hive table .

 


create table testTableNew(id int ,name string ) clustered by (id) into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');

 

insert into table testTableNew values('101','syri');

 

select * from testtablenew;

 

1102syam
2101syri
3101syri

 

 

delete from testTableNew where id = '101';

 

  • Error while compiling statement: FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

update testTableNew
set name = praveen
where id = 101;

 

  • Error while compiling statement: FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.

 

I have added few properties in hive-site.xml also :


hive.support.concurrency
true


hive.enforce.bucketing
true


hive.exec.dynamic.partition.mode
nonstrict


hive.txn.manager
org.apache.hadoop.hive.ql.lockmgr.DbTxnManager


hive.compactor.initiator.on
true


hive.compactor.worker.threads
2


hive.in.test
true

 

After restart the Hive service also same error i am facing.

Quick Start VM  - 5.8 and Hive version - 1.1.0.

Please guide me to sort this issue.

 

Thanks,

Syam.

 

 

24 REPLIES 24

Re: Update and Delete are not working in Hive ?

Champion

@syamsri

 

  1. Go to Yarn -> Configuration -> search for "yarn.nodemanager.resource.memory-mb". If it is 1 GB by default, increase it to 2 GB
  2. Save it and restart YARN
  3. (Sometime, may need to restart HUE as well, need to chk)

try again now

Re: Update and Delete are not working in Hive ?

Contributor

Thanks for the reply Saranvisa,

 

I already increased this configuration for some other reason,

But no work of update and delete operations.

 

Thanks,

Syam.

Re: Update and Delete are not working in Hive ?

Champion

@syamsri

 

how much you have increased? so i think in your case it is not sufficient, you have to increase more and try your update & delete operations

Re: Update and Delete are not working in Hive ?

Contributor

2017-07-25_0926.png

Re: Update and Delete are not working in Hive ?

Contributor

Can you try uninstalling hive and re-install it again and then try the same command.

Re: Update and Delete are not working in Hive ?

Contributor

Hi Ujjwal,

 

Thanks for the reply.

This is quickstart Vm machine 5.8.

Uninstalling is not the solution i think.

 

Thanks,

Syam

Re: Update and Delete are not working in Hive ?

Contributor

Oh ok syam i got. I did the installation part manually.

Re: Update and Delete are not working in Hive ?

Contributor

The CDH distribution of Hive does not support transactions (HIVE-5317). Currently, transaction support in Hive is an experimental feature that only works with the ORC file format. Cloudera recommends using the Parquet file format, which works across many tools. Merge updates in Hive tables using existing functionality, including statements such as INSERTINSERT OVERWRITE, and CREATE TABLE AS SELECT.

 

https://www.cloudera.com/documentation/enterprise/latest/topics/hive_ingesting_and_querying_data.htm...

 

If you require these features, please inquire about Apache Kudu.

 

Kudu is storage for fast analytics on fast data—providing a combination of fast inserts and updates alongside efficient columnar scans to enable multiple real-time analytic workloads across a single storage layer.

 

https://www.cloudera.com/products/open-source/apache-hadoop/apache-kudu.html

Re: Update and Delete are not working in Hive ?

New Contributor

Please check the link https://hortonworks.com/blog/update-hive-tables-easy-way/ hope this helps.