2017-09-06 31 views

回答

3

这是因为FileSystem.get(...)返回默认FileSystem根据您的配置是HDFS,并且只能使用从hdfs://开始的路径。使用以下来获得正确的FS。

Path p = new Path("gs://..."); 
FileSystem fs = p.getFileSystem(...); 
fs.exists(p); 
+1

谢谢,它只是通过获取文件系统像这样:'path.getFileSystem(sc.hadoopConfiguration)'' –

相关问题