[resolved] How to delete multiple files in HDFS?

Highlighted
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

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now