Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Impala truncate doesn't move to HDFS trashcan

Highlighted

Impala truncate doesn't move to HDFS trashcan

New Contributor

In documentation on impala truncate command (https://www.cloudera.com/documentation/enterprise/latest/topics/impala_truncate_table.html) it is said that trucate moves files to hdfs trashcan.
My tests shows that truncate deletes files without moving to hdfs trashcan.
I suppose truncate is handled by method "truncateTable" in class "org.apache.impala.service.CatalogOpExecutor", it deletes files without moving to trashcan.

The error is in documentation or i've misconfigured impala?
P.S. Deleting without moving to trashcan is best option, hope documentation would be fixed)

2 REPLIES 2
Highlighted

Re: Impala truncate doesn't move to HDFS trashcan

Master Collaborator
My long term observation is exactly the same, Impala removes the files without moving them into trashcan. Somewhere I read that the move to the trashcan is just a specific feature of shell commands, to prevent accidental delete. Otherwise all the "service" triggered deletes to the NameNode are without this safety net.
Highlighted

Re: Impala truncate doesn't move to HDFS trashcan

Master Collaborator

I filed a docs JIRA to track this: https://issues.apache.org/jira/browse/IMPALA-7654

 

Thanks for bringing this to our attention.

Don't have an account?
Coming from Hortonworks? Activate your account here