[英]Is it possible to read files that are not in Google Cloud Platform from Cloud DataFlow
I am trying to read a simple CSV that is outside of the Google Cloud Platform. 我正在尝试读取Google Cloud Platform之外的简单CSV。 Is it possible.
可能吗。 ?
?
Try this snippet with the local CSV file: 使用本地CSV文件尝试以下代码段:
PCollection<String> lines = p.apply(TextIO.Read.named("ReadMyFile").from("/tmp/myfile.csv"));
constructing-your-pipeline reading-data-into-your-pipeline 将管道读取数据构建到管道中
EDIT: 编辑:
Based on the manual of TextIO.Read.from() it supports local files. 基于TextIO.Read.from()的手册,它支持本地文件。
If you run the code on your local machine or non-GCP server, where the CSV file is, this snippet will be able to load the data into DataFlow. 如果您在本地计算机或非GCP服务器(即CSV文件所在的位置)上运行代码,则此代码段将能够将数据加载到DataFlow中。 TextIO.Read.From documentation
TextIO.Read.From文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.