How to check Hive Version :
Command : ps -aux | grep -i "Hive"
and the find text "/lib/hive/lib/hive-service_VERSION_NUMBER" in the above command output.
output : /opt/cloudera/parcels/CDH-5.5.5-1.cdh5.5.5.p0.3/lib/hive/lib/hive-service-1.1.0-cdh5.5.5.jar
Here hive version is 1.1.0
If your Hive version is 0.14 or greater then you can execute dml operation on hive
tables.
However, below are the
limitations :
- 1 Table that you work with must be bucketed, declared as ORC format and has in it's table properties 'transactional'='true' (hive support ACID operations only for ORC format and transactional tables). An example of a proper table is like this:
Below sql for your handy.
1. create table testTableNew(id int ,name string ) clustered by (id)
into 2 buckets stored as orc TBLPROPERTIES('transactional'='true');
2. insert into table testTableNew values (1,'row1'),(2,'row2'),(3,'row3');
3. update testTableNew set name = 'updateRow2' where id = 2;
4. delete from testTableNew where id = 1;
5. select * from testTableNew ;
hi your hadoop post for insert, update and delete in hive was useful for me during writing queries ,thanks for the useful information do check Hadoop Training in Velachery | Hadoop Training
ReplyDeletehi your hadoop post for insert, update and delete in hive was useful for me during writing queries ,thanks for the useful information do check Hadoop Training in Velachery | Hadoop Training
ReplyDeleteIt was very nice article and it is very useful to Testing tools learners.We also provide Big data hadoop online training
ReplyDelete