用apache spark/prem hadoop撰写avro文件到Google Cloud Storage

发布于 2025-02-09 08:35:24 字数 271 浏览 1 评论 0 原文

我正在尝试使用“ Hadoop”上的Hadoop上的一些Spark Workfrows迁​​移到Google Cloud Storage。

假设VPC,网络,云互连和防火墙都已井井有条,那么首先将如何将AVRO文件(目前在Parquet)编写到外部目的地,例如Google Cloud Storage?使用Oozie&例如,Spark-Submit?我需要将Google Cloud Storage映射为位置吗?我们想摆脱将HDF存储的存储,但是现在所有的工作流都目的地都在Hadoop中写入Hadoop。

I am trying to migrate some spark workflows using on premesis hadoop to google cloud storage.

Assuming VPC, networking, cloud interconnect, and firewalls are all in order, how would one first go about writing avro files (currently in parquet) to an external destination such as google cloud storage? What considerations must one make when using oozie & spark-submit for example? Do I need to map google cloud storage as a location? We want to get away from storing things in HDFS, but right now all the workflow destinations are writing into hadoop right now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我不在是我 2025-02-16 08:35:24

您可以使用

对于新/现有的Spark作业,您将需要 core-site.xml 中进行配置,然后您应该能够将数据框架写入GCS

val dataframe = spark.read.load("hdfs://some/data") // existing parquet files

dataframe.write
    .format("avro")
    .save("gs://bucket/path")

spark avro数据源

You could use DistCp rather than Spark for existing data, and configure oozie to run that.

For new/existing Spark jobs, you will need the Cloud Storage Connector and configure it in Spark's core-site.xml, then you should be able to write a dataframe to GCS

val dataframe = spark.read.load("hdfs://some/data") // existing parquet files

dataframe.write
    .format("avro")
    .save("gs://bucket/path")

Spark Avro data sources

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文