A Bug? There are two similar methods in org.apache...
# pinot-dev
c
A Bug? There are two similar methods in org.apache.pinot.plugin.filesystem.HadoopPinotFS
Copy code
@Override
  public void copyFromLocalFile(File srcFile, URI dstUri)
      throws Exception {
    if (srcFile.isDirectory()) {
      throw new IllegalArgumentException(srcFile.getAbsolutePath() + " is a direactory");
    }
    _hadoopFS.copyFromLocalFile(new Path(srcFile.toURI()), new Path(dstUri));
  }

  public void copyFromLocalDir(File srcFile, URI dstUri)
      throws Exception {
    Path srcPath = new Path(srcFile.toURI());
    if (!_hadoopFS.isDirectory(srcPath)) {
      throw new IllegalArgumentException(srcFile.getAbsolutePath() + " is not a directory");
    }
    _hadoopFS.copyFromLocalFile(srcPath, new Path(dstUri));
  }
👀 1
The second method
copyFromLocalDir
uses
_hadoopFS
to check if the given local File is a directory -
_hadoopFS.isDirectory(srcPath)
. I think it should be changed to
srcFile.isDirectory()
instead like the one in the first method.
j
cc @Xiaobing
x
It looks like a bug to me too. Thanks for digging it out @Caleb Shei , do you want to patch it? I’ll patch it later today otherwise. Just lemme know.
c
No, I changed it locally because I build it from the source.