本文介绍了使用Java API将Parquet格式写入HDFS,而不使用Avro和MR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过直接创建Poquet的Parquet架构来将 Parquet格式写入 HDFS (使用Java API)的简单方法是:使用 avro MR



我发现的示例已过时,并且使用不推荐使用的方法也使用Avro, spark或MR。

解决方案

实际上,没有大量样本可用于读取/写入Apache parquet文件,一个外部框架。

核心parquet库是parquet-column,您可以直接找到一些测试文件读/写:



您那么只需要使用相同的功能带有HDFS文件。你可以关注这个SOW问题:



更新:回应已弃用的部分API:AvroWriteSupport应由AvroParquetWriter取代,并检查ParquetWriter,不要弃用并可安全使用。 b
$ b

问候,

Loïc


What is the simple way to write Parquet Format to HDFS (using Java API) by directly creating Parquet Schema of a Pojo, without using avro and MR?

The samples I found were outdated and uses deprecated methods also uses one of Avro, spark or MR.

解决方案

Effectively, there is not a lot of sample available for reading/writing Apache parquet files without the help of an external framework.

The core parquet library is parquet-column where you can find some test files reading/writing directly : https://github.com/apache/parquet-mr/blob/master/parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java

You then just need to use the same functionality with an HDFS file. You can follow this SOW question for this : Accessing files in HDFS using Java

UPDATED : to respond to the deprecated parts of the API : AvroWriteSupport should be replaced by AvroParquetWriter and I check ParquetWriter it's not deprecated and can be used safely.

Regards,

Loïc

这篇关于使用Java API将Parquet格式写入HDFS,而不使用Avro和MR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 23:37