Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

truncate partition external table

avatar
Frequent Visitor

Hi All,

Can we truncate partition external table ?

Sharing an example where i faced the issue .

hive> truncate table abc.Stage_xact_personall_region_of_Sale partition (region_code='TYES');

FAILED: SemanticException [Error 10146]: Cannot truncate non-managed table abc.Stage_xact_personall_region_of_Sale .

Help will be much appreciated ASAP .

-Thanks

Satish

1 ACCEPTED SOLUTION
2 REPLIES 2

avatar
Frequent Visitor

Thanks a lot ..

It works

Consolidated answer

ALTER TABLE abc.Stage_xact_personall_region_of_Sale DROP PARTITION (region_code='TYES');

Then do an overwrite on it

insert overwrite table abc.Stage_xact_personall_region_of_Sale partition(region_code) select * from xyz.Region_Sale where region_code='TYES';

-Thanks

Satish