<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Update and delete in hive in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148183#M20135</link>
    <description>&lt;P&gt;Hi Experts, &lt;/P&gt;&lt;P&gt;I was trying to do insert,update and delete in a Hive table. 
Though insert worked for me update and delete didn't worked. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I set following properties before executing any DDL/DML : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;set hive.support.concurrency=true; set hive.enforce.bucketing=true; set hive.exec.dynamic.partition.mode=nonstrict; set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; set hive.compactor.initiator.on=true; set hive.compactor.worker.threads=1; &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Then following table created : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE students (name VARCHAR(64), age INT, gpa DECIMAL(3, 2))
  CLUSTERED BY (age) INTO 2 BUCKETS STORED AS ORC
   TBLPROPERTIES ('transactional'='true'); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Following insert worked : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;INSERT INTO TABLE students
VALUES ('AA', 23, 1.28), ('BB', 32, 2.32); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Following update/delete are falling : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;UPDATE students SET gpa = 3.12 WHERE name='AA';
delete from students WHERE age=32; &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Could you please help me to understand the issue ? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hive version is as below -&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[hdfs@sandbox ~]$ hive --version
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt; for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
WARNING: Use "yarn jar" to launch YARN applications. 
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt; for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
Hive 1.2.1.2.3.2.0-2950 
Subversion git://c66-slave-20176e25-6/grid/0/jenkins/workspace/HDP-2.3-maint-centos6/bigtop/build/hive/rpm/BUILD/hive-1.2.1.2.3.2.0 -r c67988138ca472655a6978f50c7423525b71dc27 &lt;/PRE&gt;&lt;P&gt;Compiled by jenkins on Wed Sep 30 19:07:31 UTC 2015 &lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Soumya&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2016 23:01:13 GMT</pubDate>
    <dc:creator>soumyabrata_kol</dc:creator>
    <dc:date>2016-02-18T23:01:13Z</dc:date>
    <item>
      <title>Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148183#M20135</link>
      <description>&lt;P&gt;Hi Experts, &lt;/P&gt;&lt;P&gt;I was trying to do insert,update and delete in a Hive table. 
Though insert worked for me update and delete didn't worked. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I set following properties before executing any DDL/DML : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;set hive.support.concurrency=true; set hive.enforce.bucketing=true; set hive.exec.dynamic.partition.mode=nonstrict; set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; set hive.compactor.initiator.on=true; set hive.compactor.worker.threads=1; &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Then following table created : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE students (name VARCHAR(64), age INT, gpa DECIMAL(3, 2))
  CLUSTERED BY (age) INTO 2 BUCKETS STORED AS ORC
   TBLPROPERTIES ('transactional'='true'); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Following insert worked : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;INSERT INTO TABLE students
VALUES ('AA', 23, 1.28), ('BB', 32, 2.32); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Following update/delete are falling : &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;UPDATE students SET gpa = 3.12 WHERE name='AA';
delete from students WHERE age=32; &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Could you please help me to understand the issue ? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hive version is as below -&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[hdfs@sandbox ~]$ hive --version
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt; for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
WARNING: Use "yarn jar" to launch YARN applications. 
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt; for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 
Hive 1.2.1.2.3.2.0-2950 
Subversion git://c66-slave-20176e25-6/grid/0/jenkins/workspace/HDP-2.3-maint-centos6/bigtop/build/hive/rpm/BUILD/hive-1.2.1.2.3.2.0 -r c67988138ca472655a6978f50c7423525b71dc27 &lt;/PRE&gt;&lt;P&gt;Compiled by jenkins on Wed Sep 30 19:07:31 UTC 2015 &lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Soumya&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 23:01:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148183#M20135</guid>
      <dc:creator>soumyabrata_kol</dc:creator>
      <dc:date>2016-02-18T23:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148184#M20136</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/2799/soumyabratakole.html" nodeid="2799"&gt;@soumyabrata kole&lt;/A&gt;&lt;P&gt; See this &lt;A href="https://community.hortonworks.com/content/kbentry/4321/hive-acid-current-state.html" target="_blank"&gt;https://community.hortonworks.com/content/kbentry/4321/hive-acid-current-state.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 23:02:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148184#M20136</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-02-18T23:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148185#M20137</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2799/soumyabratakole.html" nodeid="2799" target="_blank"&gt;@soumyabrata kole&lt;/A&gt; &lt;/P&gt;&lt;P&gt;hive&amp;gt; UPDATE students SET gpa = 3.12 WHERE name='AA'; delete from students WHERE age=32;&lt;/P&gt;&lt;P&gt;FAILED: SemanticException [Error 10294]: Attempt to do update or delete using transaction manager that does not support these operations.&lt;/P&gt;&lt;P&gt;hive&amp;gt; &lt;/P&gt;&lt;P&gt;I enabled ACID transaction and I can run it "It's not recommended in production" &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2241-screen-shot-2016-02-18-at-101255-am.png" style="width: 1534px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21337iF1C96B5FAAC88AE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2241-screen-shot-2016-02-18-at-101255-am.png" alt="2241-screen-shot-2016-02-18-at-101255-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Update:  It did not update the gpa value. &lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 13:14:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148185#M20137</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2019-08-18T13:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148186#M20138</link>
      <description>&lt;P&gt;Thanks Neeraj for your answer. &lt;/P&gt;&lt;P&gt;However, I could not find how to enable ACID transactions from the link -&lt;A href="https://hortonworks.app.box.com/files/0/f/2070270300/1/f_37967540402"&gt;https://hortonworks.app.box.com/files/0/f/2070270300/1/f_37967540402&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also other links which are present in the page of above link are not working.&lt;/P&gt;&lt;P&gt;Could you please tell me the steps to enable ACID transactions.&lt;/P&gt;&lt;P&gt;Thanks again !&lt;/P&gt;&lt;P&gt;Soumya&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 23:31:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148186#M20138</guid>
      <dc:creator>soumyabrata_kol</dc:creator>
      <dc:date>2016-02-18T23:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148187#M20139</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2242-screen-shot-2016-02-18-at-103459-am.png" style="width: 520px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21336i47432FC3F8999830/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2242-screen-shot-2016-02-18-at-103459-am.png" alt="2242-screen-shot-2016-02-18-at-103459-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can use ambari to enable ACID. &lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 13:14:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148187#M20139</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2019-08-18T13:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148188#M20140</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2799/soumyabratakole.html" nodeid="2799" target="_blank"&gt;@soumyabrata kole&lt;/A&gt;  Update worked using beeline&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2243-screen-shot-2016-02-18-at-104503-am.png" style="width: 2370px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21335iD46BCC07865406F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2243-screen-shot-2016-02-18-at-104503-am.png" alt="2243-screen-shot-2016-02-18-at-104503-am.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 13:14:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148188#M20140</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2019-08-18T13:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148189#M20141</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2799/soumyabratakole.html" nodeid="2799"&gt;@soumyabrata kole&lt;/A&gt;   It's working though beeline &lt;A rel="user" href="https://community.cloudera.com/users/2799/soumyabratakole.html" nodeid="2799"&gt;@soumyabrata kole&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 04:41:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148189#M20141</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-02-19T04:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148190#M20142</link>
      <description>&lt;P&gt;try "set hive.txn.manager" and see what it prints.  This is "sticky" setting so set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager won't always take effect.  It's more reliable to set it in hive-site.xml&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 08:25:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148190#M20142</guid>
      <dc:creator>ekoifman</dc:creator>
      <dc:date>2016-02-24T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148191#M20143</link>
      <description>&lt;P&gt;hive doesn't support DML queries,
if create a ACID property to do this,&lt;/P&gt;&lt;P&gt;
set this properties &lt;/P&gt;&lt;P&gt;    SET hive.support.concurrency=true; &lt;/P&gt;&lt;P&gt;SET hive.enforce.bucketing=true; &lt;/P&gt;&lt;P&gt;SET hive.exec.dynamic.partition.mode=nonstrict; &lt;/P&gt;&lt;P&gt;SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; &lt;/P&gt;&lt;P&gt;SET hive.compactor.initiator.on=true;
SET hive.compactor.worker.threads=1; &lt;/P&gt;&lt;P&gt;SET hive.support.concurrency=true; &lt;/P&gt;&lt;P&gt;SET hive.enforce.bucketing=true; &lt;/P&gt;&lt;P&gt;then create a hive table using bucketing and stored as ORC file format,
then do the update and delete queries in hive,
for more information on hive DML go this blog for step by step process &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geoinsyssoft.com/hive-dml-update-delete-operations/" target="_blank"&gt;http://www.geoinsyssoft.com/hive-dml-update-delete-operations/&lt;/A&gt;&lt;/P&gt;,&lt;P&gt;hive doesn't support DML queries,
if create a ACID property to do this,
set this properties
    SET hive.support.concurrency=true;
SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.compactor.initiator.on=true;
SET hive.compactor.worker.threads=1;
SET hive.support.concurrency=true;
SET hive.enforce.bucketing=true;
then create a hive table using bucketing and stored as ORC file format,
then do the update and delete queries in hive,
for more information on hive DML go this blog for step by step process
&lt;A href="http://www.geoinsyssoft.com/hive-dml-update-delete-operations/" target="_blank"&gt;http://www.geoinsyssoft.com/hive-dml-update-delete-operations/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 14:33:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148191#M20143</guid>
      <dc:creator>rsb001happy</dc:creator>
      <dc:date>2016-08-24T14:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Update and delete in hive</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148192#M20144</link>
      <description>&lt;P&gt;For me this setting is disabled .I can not make any changes.Can you please let me know how to on the ACID properties?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 13:39:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Update-and-delete-in-hive/m-p/148192#M20144</guid>
      <dc:creator>pooja_shrivasta</dc:creator>
      <dc:date>2017-10-17T13:39:38Z</dc:date>
    </item>
  </channel>
</rss>

