简体   繁体   English

使用 Apache Flume 将 CSV 转换为 Parquet?

[英]Transform CSV into Parquet using Apache Flume?

I have a question, is it possible to execute ETL for data using flume.我有一个问题,是否可以使用水槽对数据执行 ETL。 To be more specific I have flume configured on spoolDir which contains CSV files and I want to convert those files into Parquet files before storing them into Hadoop. Is it possible?更具体地说,我在包含 CSV 个文件的 spoolDir 上配置了水槽,我想在将这些文件存储到 Hadoop 之前将这些文件转换为 Parquet 文件。这可能吗?

If it's not possible would you recommend transforming them before storing in Hadoop or transform them using spark on Hadoop?如果不可能,您会建议在存储到 Hadoop 之前转换它们,还是在 Hadoop 上使用 spark 转换它们?

I'd probably suggest using nifi to move the files around.我可能会建议使用nifi来移动文件。 Here's a specific tutorial on how to do that with Parquet .这是有关如何使用Parquet执行此操作的具体教程。 I feel nifi was the replacement for Apache Flume.我觉得 nifi 是 Apache Flume 的替代品。

Flume partial answers:(Not Parquet) If you are flexible on format you can use an avro sink. Flume 部分答案:(不是 Parquet)如果您对格式灵活,则可以使用 avro 接收器。 You can use a hive sink and it will create a table in ORC format.(You can see if it also allows parquet in the definition but I have heard that ORC is the only supported format.)您可以使用 hive 接收器,它将创建一个 ORC 格式的表。(您可以查看它是否也允许在定义中使用镶木地板,但我听说 ORC 是唯一受支持的格式。)

You could likely use some simple script to use hive to move the data from the Orc table to a Parquet table.您可能会使用一些简单的脚本来使用 hive 将数据从 Orc 表移动到 Parquet 表。 (Converting the files into the parquet files you asked for.) (将文件转换为您要求的镶木地板文件。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM