简体   繁体   English

在 GCP 中将数据从 VM 实例传输到 BigQuery

[英]Transferring data from VM Instances to BigQuery in GCP

I am trying to transfer some files to BigQuery which are stored in my VM Instances.我正在尝试将一些文件传输到存储在我的 VM 实例中的 BigQuery。 Normally we do a two steps process:通常我们做一个两步的过程:

  1. Transfer files from VM instances to Cloud Storage bucket.将文件从 VM 实例传输到 Cloud Storage 存储分区。
  2. Getting data from Cloud Storage bucket to BigQuery.将数据从 Cloud Storage 存储分区获取到 BigQuery。

Now, I want to take files directly from VM Instances to BigQuery platform.现在,我想将文件直接从 VM 实例带到 BigQuery 平台。 Is there any way to do it?有什么办法吗?

You can load data directly from a readable data source (such as your local machine) by using:您可以使用以下方法直接从可读数据源(例如本地计算机)加载数据:

  • The Cloud Console or the classic BigQuery web UI Cloud Console 或经典 BigQuery web 界面
  • The bq command-line tool's bq load command bq 命令行工具的 bq load 命令
  • The API API
  • The client libraries客户端库

Please, follow the official documentation to see examples of using each way.请按照官方文档查看每种方式的使用示例。

Moreover, if you want to stay with idea of sending your files to Cloud Storage bucket, you can think about using Dataflow templates:此外,如果您想保留将文件发送到 Cloud Storage 存储桶的想法,您可以考虑使用 Dataflow 模板:

  • Cloud Storage Text to BigQuery ( Stream )云存储文本到 BigQuery ( Stream )
  • Cloud Storage Text to BigQuery ( Batch )云存储文本到 BigQuery( 批量

which allows you to read text files stored in Cloud Storage, transform them using a JavaScript User Defined Function (UDF) that you provide, and output the result to BigQuery.它允许您读取存储在 Cloud Storage 中的文本文件,使用您提供的 JavaScript 用户定义 Function (UDF) 和 output 将结果转换为It is automated solution.它是自动化的解决方案。

I hope you find the above pieces of information useful.我希望您发现上述信息有用。

The solution would be to use bq command for this.解决方案是为此使用 bq 命令。 The command would be like this: bq load --autodetect --source_format=CSV xy abc.csv命令如下: bq load --autodetect --source_format=CSV xy abc.csv

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

相关问题 虚拟机实例的 GCP 补丁合规性数据 - 获取/列出 API - GCP patch compliance data of VM Instances - get/list API 将数据从 GCP (BIgquery) 迁移到 Teradata - Migrating data from GCP (BIgquery) to Teradata GCP:无法从 ubuntu/debian VM 实例上的 GCP 私有容器注册表中提取 docker 镜像 - GCP: Unable to pull docker images from our GCP private container registry on ubuntu/debian VM instances Airflow 2:将数据从 BigQuery 传输到 Cloud Storage 时找不到作业 - Airflow 2: Job Not Found when transferring data from BigQuery into Cloud Storage 需要 GCP 虚拟机实例的启动和停止时间 - Need Start and Stop times for GCP VM instances 无法通过 SSH 连接到曾经可以工作的 GCP 虚拟机实例 - Cannot SSH into the GCP VM instances that used to work 如何使用 terraform 停止 GCP vm 实例 - How to stop GCP vm instances using terraform GCP 列出虚拟机实例并获取外部 IP - GCP List vm instances and Get External IPs GCP 虚拟机实例计划未启动附加实例 - GCP VM instances schedule is not starting the attached instance GCP Dataflow- 从 Compute Engine VM 读取 CSV 文件并写入 BigQuery - GCP Dataflow- read CSV file from Compute Engine VM and write into BigQuery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM