Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 06-10-2016 09:20 AM
The nested partition structure is as below.
/dbdata/tblocation/ordersummery/tran_date=2016-04-06/ordertype=SUPE
hive> ALTER TABLE dtl.ordersummery PARTITION (tran_date='2016-04-06') COMPACT 'minor';
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Compaction can only be requested on one partition at a time.
hive> ALTER TABLE dtl.ordersummery PARTITION (tran_date='2016-04-06/ordertype=SUPE') COMPACT 'minor';
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Invalid partition spec specified
Created 06-10-2016 09:23 AM
can you try this?
ALTER TABLE dtl.ordersummery PARTITION (tran_date='2016-04-06',ordertype='SUPE') COMPACT 'minor';
Created 06-10-2016 09:23 AM
can you try this?
ALTER TABLE dtl.ordersummery PARTITION (tran_date='2016-04-06',ordertype='SUPE') COMPACT 'minor';
Created 06-10-2016 09:47 AM
thanks it works.
Created 06-10-2016 06:12 PM
I'll add this to the HWKs hive docs. Thanks @Rajkumar Singh
Created 09-28-2017 05:00 PM
CREATETABLE resource.hello_acid (key int, value int)
PARTITIONED BY (load_date date)
CLUSTERED BY(key) INTO 3 BUCKETS
STORED AS ORC TBLPROPERTIES ('transactional'='true');INSERT INTO hello_acid partition (load_date='2016-03-03') VALUES (1, 1);
INSERT INTO hello_acid partition (load_date='2016-03-03') VALUES (2, 2);
INSERT INTO hello_acid partition (load_date='2016-03-03') VALUES (3, 3);
ALTER TABLE hello_acid partition (load_date='2016-03-03') COMPACT 'minor';
SHOW COMPACTIONS;
+-----------+-------------------------------+-----------------------+--------+------------+---------------------------------+----------------+--+
| dbname | tabname | partname | type | state | workerid | starttime |
+-----------+-------------------------------+-----------------------+--------+------------+---------------------------------+----------------+--+
| Database | Table | Partition | Type | State | Worker | Start Time |
| resource | hello_acid | load_date=2016-03-03 | MINOR | failed | hadoop-master1.claro.com.co-52 | 1506440161747 |
| resource | hello_acid | load_date=2016-03-03 | MAJOR | failed | hadoop-master2.claro.com.co-46 | 1506440185353 |
+-----------+-------------------------------+-----------------------+--------+------------+---------------------------------+----------------+--+
Created 09-05-2018 05:54 PM
you are not getting the desired result as your compaction has failed. please check the yarn log to understand what might have gone wrong.