[resolved] How to delete multiple files in HDFS?

One Star

[resolved] How to delete multiple files in HDFS?

Hi,
I was trying to delete multiple files using tHDFSDelete by specifying multiple file path seperated by comma(,). but it was not working. Later I saw generated code for tHDFSDelete then I came to know that I can't enter multiple file paths.
Is there any way in Talend to delete multiple files (may be in same or in different directory ) from HDFS?

Thanks,
Bhavesh

Accepted Solutions
Community Manager

Re: [resolved] How to delete multiple files in HDFS?

Hi
Try to use tHDFSList to literate each file that you want to delete. For example:
tHDFSList--iterate--tHDFSDelete
There is a global variable that stores the current file path on tHDFSList:
(String)globalMap.get("tHDFSList_1_CURRENT_FILEPATH")
Set the file path of tHDFSdDelete with this variable.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] How to delete multiple files in HDFS?

Hi
Try to use tHDFSList to literate each file that you want to delete. For example:
tHDFSList--iterate--tHDFSDelete
There is a global variable that stores the current file path on tHDFSList:
(String)globalMap.get("tHDFSList_1_CURRENT_FILEPATH")
Set the file path of tHDFSdDelete with this variable.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download