从Azure Blob存储中读取连续的镶木材料文件作为dataStream

发布于 2025-01-18 23:16:35 字数 788 浏览 1 评论 0原文

  1. 我想读取具有格式 yyyy-mm-dd/hh/mm/file_name.parquet

    的目录中每秒在Azure Blob存储中生成的parquet文件。
  2. 我想将数据读为datastream。

我们是否已经定义了任何可以做到这一点的Flink源?

我尝试使用:

// Partial version 1: the raw file is processed continuously
val path: String = "hdfs://hostname/path_to_file_dir/"
val textInputFormat: TextInputFormat = new TextInputFormat(new Path(path))
// monitor the file continuously every minute
val stream: DataStream[String] = streamExecutionEnvironment.readFile(textInputFormat, path, FileProcessingMode.PROCESS_CONTINUOUSLY, 60000)

上述方法中的问题:

  1. 无法找到ReadParquetFile支持。

  2. 它仅从路径中传递的特定目录处理文件。在我的情况下,给定目录格式为 yyyy-mm-dd/hh/mm/file_name.parquet

  1. I want to read parquet files that are generated on Azure blob storage every second in the directory having format YYYY-MM-DD/HH/MM/file_name.parquet

  2. I want to read the data as DataStream.

Do we have any Flink source already defined that can do this?

I tried to use :

// Partial version 1: the raw file is processed continuously
val path: String = "hdfs://hostname/path_to_file_dir/"
val textInputFormat: TextInputFormat = new TextInputFormat(new Path(path))
// monitor the file continuously every minute
val stream: DataStream[String] = streamExecutionEnvironment.readFile(textInputFormat, path, FileProcessingMode.PROCESS_CONTINUOUSLY, 60000)

Issues in the above approach:

  1. Was not able to find readParquetFile support.

  2. It was processing file only from a specific directory passed in the path. In my case directories are changing every minute given the directory format is YYYY-MM-DD/HH/MM/file_name.parquet

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文