[英]GCP Dataflow - How to read the data from Google BigQuery and load into Google Spanner using Dataflow
[英]Read the data from Google Cloud Sql to BigQuery using Clud Dataflow
我们实际上计划使用 CloudDataflow 将 CloudSql 中的数据读入 BigQuery。 当我尝试运行下面提到的代码时,我收到错误消息“未提供驱动程序类名称”。
有人知道如何传递这行代码“options.getDriverClassName()”的值吗?
@Panciz,@guillaume blaquiere
我自己找到了解决方案。 如果您查看以下来自 Google 的链接
我们需要传递上面链接中提到的参数。 因为,我正在运行 IntelliJ 的“JdbcToBigQuery”数据流模板,所以我将这些参数作为程序参数传递,如下所述,并且它起作用了。
--project=<google cloud project name>
--stagingLocation=gs://<location>
--gcpTempLocation=gs://<location>
--serviceAccount=<service account for dataflow>
--runner=DirectRunner
--driverJars=gs://<location>/postgres-socket-factory-1.0.15-jar-with-dependencies.jar
--bigQueryLoadingTemporaryDirectory=gs://<location>
--driverClassName=org.postgresql.Driver
--connectionURL=jdbc:postgresql://google/<your google cloud postgres db name>?cloudSqlInstance=<your google cloud project name>:europe-west1:<your google cloud postgres instance name>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&useSSL=false
--username=<your username>
--password=<your passsowrd>
--query="<your sql query>"
--outputTable=<your google cloud project name>:<your google cloud dataset name>.<your google cloud table name>
--connectionProperties=unicode=true&characterEncoding=UTF-8
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.