Github user zhangminglei commented on a diff in the pull request:
https://github.com/apache/flink/pull/4168#discussion_r124175328
--- Diff:
flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java ---
@@ -461,8 +463,9 @@ public LocatableInputSplitAssigner
getInputSplitAssigner(FileInputSplit[] splits
// take the desired number of splits into account
minNumSplits = Math.max(minNumSplits, this.numSplits);
-
- final Path path = this.filePath;
+
+ final Path path = new
Path(URLDecoder.decode(this.filePath.toString(),
Charset.defaultCharset().name()));
--- End diff --
I have updated the code. Please check again. One thing we should concern
though.
FYI, though, it is not very relevant to this issue here.
We can see, for **1** and **2** output results, they are both the same.
That is to say, call ```toString()``` from ```toURI()``` does not change the
internal of the result. But, if we call them in context of
```flink.core.fs.Path```. what I got is **3** and **4** outputs. **It seems
```new Path``` change someting stuff**. I guess that we should expect that not
happen under this context. Instead, I expect ```new
Path(parentDirTest.toURI().toString())``` return the same value as ```new
Path(parentDirTest.toURI())```. Now, they are not equal.
```File parentDirTest = new File("D:\\projects\\hello world");```
```System.out.println(parentDirTest.toURI()); ```
1. **Output: file:/D:/projects/hello%20world/**
```System.out.println(parentDirTest.toURI().toString());```
2. **Output: file:/D:/projects/hello%20world/**
```System.out.println(new Path(parentDirTest.toURI())); ```
3. **Output: file:/D:/projects/hello world/**
```System.out.println(new Path(parentDirTest.toURI().toString()));```
4. **Output: file:/D:/projects/hello%20world**
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---