Drop an acid table failed in HIVE

512 Views Asked by At

I tried to drop an acid table in HIVE and it throws an error like this:

Unable to get table: java.lang.Exception: ErrorCode: InternalError, Message:Not enable acid table

DDL:

create table `test`( `id` string,  `c1` string ) 
PARTITIONED BY (created_date date) CLUSTERED BY(id) INTO 6 BUCKETS 
STORED AS ORC TBLPROPERTIES (
    'orc.compress'='ZLIB', 
    'transactional'='true' );

So how can I drop this table?

1

There are 1 best solutions below

0
Koushik Roy On

You need to set up hive Transaction manager properly before work with these kind of tables. Please run this command before your SQL to work with ACID tables.
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;

SQL i used are below -

create table test( id string, c1 string ) PARTITIONED BY (created_date date) 
CLUSTERED BY(id) INTO 6 BUCKETS STORED AS ORC TBLPROPERTIES ( 'orc.compress'='ZLIB', 'transactional'='true' );

SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
insert into test partition(created_date) select 'a','b',current_date();
select * from test;

my result

For permanent fix, you need to add below entries to hive-site.xml file.

SET hive.support.concurrency=true;
SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nonstrict;