2017-03-03 79 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)); 
} 

感谢