hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Gates <ga...@hortonworks.com>
Subject Re: UPDATE in Hive -0.14.0
Date Wed, 03 Dec 2014 02:11:37 GMT
You have to use ORC as the table format (it's the only format that 
supports update and delete at this point), and you have to explicitly 
mark the table as transactional.  You must also bucket the table. For 
example:

create table HiveTest (...) clustered by (_col_) into _num_ buckets 
stored as orc tblproperties('transactional' = 'true');

Alan.

> unmesha sreeveni <mailto:unmeshabiju@gmail.com>
> November 24, 2014 at 1:39
> Created a Table in Hive
>
> create external table HiveTest (EmployeeID Int,FirstName 
> String,Designation String,Salary Int,Department String) row format 
> delimited fields terminated by "," location '/user/aibladmin/Hive';
> And set all the properties in hive-site.xml
> 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 – 1
>
> The when I tried
> hive>
> >
> > UPDATE HiveTest SET salary = 50000 WHERE employeeid = 19;
> FAILED: SemanticException [Error 10297]: Attempt to do update or 
> delete on table default.HiveTest that does not use an AcidOutputFormat 
> or is not bucketed
>
>  Is it beacause of hive.enforce.bucketing – true set in hive-site.xml
> Is bucketing like partition?
>
>
>
>
>
>
>
>
> -- 
> */Thanks & Regards/ *
> /*
> */
> *Unmesha Sreeveni U.B/
> /*
> *Hadoop, Bigdata Developer*
> *Centre for Cyber Security | Amrita Vishwa Vidyapeetham*
> http://www.unmeshasreeveni.blogspot.in/
>
> /
> /
> Mahesh Kumar <mailto:sankarmahesh37@gmail.com>
> November 24, 2014 at 1:25
> Hi unmesha sreevani,
>
> *Create metastore in mysql and create the tables as per the below link.*
> https://github.com/apache/hive/blob/trunk/metastore/scripts/upCreate 
> metastore in mysql and create the tables as per the below 
> link.grade/mysql/hive-schema-0.14.0.mysql.sql 
> <https://github.com/apache/hive/blob/trunk/metastore/scripts/upgrade/mysql/hive-schema-0.14.0.mysql.sql>.
>
> *And add these properties in hive-site.xml.*
>
> <property>
> <name>hive.support.concurrency</name>
> <value>true</value>
> </property>
>
> <property>
> <name>hive.enforce.bucketing</name>
> <value>true</value>
> </property>
>
> <property>
> <name>hive.exec.dynamic.partition.mode</name>
> <value>nonstrict</value>
> </property>
>
> <property>
> <name>hive.txn.manager</name>
> <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
> </property>
>
> <property>
> <name>hive.compactor.initiator.on</name>
> <value>true</value>
> </property>
>
> <property>
> <name>hive.compactor.worker.threads</name>
> <value>1</value>
> </property>
>
> *Make sure your table creation supports ACID ouput format.Create like 
> following*.
>
> create table test(id int, name varchar(128)) clustered by (id) into 2 
> buckets stored as orc TBLPROPERTIES ('transactional'='true')
>
>
> Regards,
>
> Mahesh.S
> @Sanjiv Singh <mailto:sanjiv.is.on@gmail.com>
> November 24, 2014 at 0:39
> Make sure you have configured these properties hive-site.xml
>
> hive.support.concurrency
> hive.enforce.bucketing
> hive.exec.dynamic.partition.mode
> hive.txn.manager
> hive.compactor.initiator.on
> hive.compactor.worker.threads
>
>
> also following property has been set at table level
> TBLPROPERTIES('transactional'='true')
>
> Regards
> Sanjiv Singh
> Mob :  +091 9990-447-339
>
>
> Nitin Pawar <mailto:nitinpawar432@gmail.com>
> November 24, 2014 at 0:28
>
> whats your create table DDL?
>
> unmesha sreeveni <mailto:unmeshabiju@gmail.com>
> November 24, 2014 at 0:10
> Hi
>
> I am using hive -0.14.0 which support UPDATE statement
>
> but I am getting an error once I did this Command
> UPDATE Emp SET salary = 50000 WHERE employeeid = 19;
>
> FAILED: SemanticException [Error 10294]: Attempt to do update or 
> delete using transaction manager that does not support these operations.
> hive>
>
>
> Am I doing anything wrong?
>
> -- 
> */Thanks & Regards/ *
> /*
> */
> *Unmesha Sreeveni U.B/
> /*
> *Hadoop, Bigdata Developer*
> *Centre for Cyber Security | Amrita Vishwa Vidyapeetham*
> http://www.unmeshasreeveni.blogspot.in/
>
> /
> /

-- 
Sent with Postbox <http://www.getpostbox.com>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Mime
View raw message