2017-03-03 74 views

回答

0

Avro是序列化框架,旨在以avro格式存儲數據,它沒有任何寫入HDFS的智能。

您需要使用HDFS API上傳/寫avros到HDFS,使用類似的東西在Python ,其中srcPath是當地的Avro和dstPath是HDFS

public void uploadToHdfs(String srcPath, String dstPath) throws IOException { 
     FileSystem fs = getFileSystem(); 
     fs.copyFromLocalFile(new Path(srcPath), new Path(dstPath)); 
} 

感謝