[ 
https://issues.apache.org/jira/browse/HADOOP-19196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852870#comment-17852870
 ] 

Steve Loughran edited comment on HADOOP-19196 at 6/6/24 5:01 PM:
-----------------------------------------------------------------

we need a contract test for this.


code to trigger this
{code}
io.bulkDelete_delete(fs, path, Lists.newArrayList(path)))
{code}

{code}
java.lang.IllegalArgumentException: Path 
file:/Users/stevel/Projects/hadoop-trunk/hadoop-common-project/hadoop-common/target/test/data/zfms3Bqvmq/testOpenLocalFile
 is not under the base path 
file:/Users/stevel/Projects/hadoop-trunk/hadoop-common-project/hadoop-common/target/test/data/zfms3Bqvmq/testOpenLocalFile

        at 
org.apache.hadoop.util.Preconditions.checkArgument(Preconditions.java:213)
        at 
org.apache.hadoop.fs.BulkDeleteUtils.lambda$validateBulkDeletePaths$0(BulkDeleteUtils.java:45)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at 
org.apache.hadoop.fs.BulkDeleteUtils.validateBulkDeletePaths(BulkDeleteUtils.java:43)
        at 
org.apache.hadoop.fs.impl.DefaultBulkDeleteOperation.bulkDelete(DefaultBulkDeleteOperation

{code}



was (Author: [email protected]):
we need a contract test for this.
{code}
java.lang.IllegalArgumentException: Path 
file:/Users/stevel/Projects/hadoop-trunk/hadoop-common-project/hadoop-common/target/test/data/zfms3Bqvmq/testOpenLocalFile
 is not under the base path 
file:/Users/stevel/Projects/hadoop-trunk/hadoop-common-project/hadoop-common/target/test/data/zfms3Bqvmq/testOpenLocalFile

        at 
org.apache.hadoop.util.Preconditions.checkArgument(Preconditions.java:213)
        at 
org.apache.hadoop.fs.BulkDeleteUtils.lambda$validateBulkDeletePaths$0(BulkDeleteUtils.java:45)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at 
org.apache.hadoop.fs.BulkDeleteUtils.validateBulkDeletePaths(BulkDeleteUtils.java:43)
        at 
org.apache.hadoop.fs.impl.DefaultBulkDeleteOperation.bulkDelete(DefaultBulkDeleteOperation

{code}


> Bulk delete api doesn't take the path to delete as the base path
> ----------------------------------------------------------------
>
>                 Key: HADOOP-19196
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19196
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 3.5.0, 3.4.1
>            Reporter: Steve Loughran
>            Assignee: Mukund Thakur
>            Priority: Minor
>
> If you use the path of the file you intend to delete as the base path, you 
> get an error. This is because the validation requires the list to be of 
> children, but the base path itself should be valid.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to