JackWangCS opened a new pull request #14452:
URL: https://github.com/apache/flink/pull/14452
## What is the purpose of the change
HiveTableInputFormat will throws the IllegalArgumentException if partitions
of a table are in different HDFS nameservices:
```java
Caused by: java.lang.IllegalArgumentException: Wrong FS:
hdfs://ns1/hive/warehouse/test.db/flink_test/day=4, expected: hdfs://ns2
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:662)
at
org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:222)
at
org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:114)
at
org.apache.hadoop.hdfs.DistributedFileSystem$20.doCall(DistributedFileSystem.java:1266)
at
org.apache.hadoop.hdfs.DistributedFileSystem$20.doCall(DistributedFileSystem.java:1262)
at
org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at
org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1262)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1418)
at
org.apache.flink.connectors.hive.read.HiveTableInputFormat.createInputSplits(HiveTableInputFormat.java:299)
at
org.apache.flink.connectors.hive.read.HiveTableInputFormat.createInputSplits(HiveTableInputFormat.java:282)
at
org.apache.flink.connectors.hive.HiveTableSource.createBatchSource(HiveTableSource.java:214)
at
org.apache.flink.connectors.hive.HiveTableSource.getDataStream(HiveTableSource.java:188)
```
## Brief change log
- Use inputPath to get FileSystem when checking the input existence
## Verifying this change
*(Please pick either of the following options)*
This change is already covered by existing tests, such as
*TableEnvHiveConnectorITCase.testNonExistingPartitionFolder()*.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializer: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? NA
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]