简体   繁体   English

Mercari Spanner 到 Bigquery - QUERY 中无法识别的参数

[英]Mercari Spanner to Bigquery - unrecognized argument in QUERY

Using the Mercari Tempalate for Spanner to BigQuery - https://github.com/mercari/DataflowTemplates将 Mercari 模板用于 Spanner to BigQuery - https://github.com/mercari/DataflowTemplates

When building the dataflow through Google Console - it works.通过 Google 控制台构建数据流时 - 它有效。

But when executing the dataflow command through CLI, it generates an error "unrecognized arguments".但是当通过 CLI 执行数据流命令时,它会生成错误“无法识别的参数”。

DATAFLOW COMMAND:数据流命令:

gcloud dataflow jobs run mercari_CLI --gcs-location gs://mystorage/templates/SpannerToBigQuery --region us-central1 --staging-location gs://mystorage/temp --parameters projectId=myProject,instanceId=myspanner,databaseId=mydpspanner,query=SELECT *, current_timestamp AS LoadDttm FROM source_table,output=raw_data_zone.testtable gcloud 数据流作业运行 mercari_CLI --gcs-location gs://mystorage/templates/SpannerToBigQuery --region us-central1 --staging-location gs://mystorage/temp --parameters projectId=myProject,instanceId=myspanner,databaseId= mydpspanner,query=SELECT *,current_timestamp AS LoadDttm FROM source_table,output=raw_data_zone.testtable

Tried the following, but same error:尝试了以下,但同样的错误:

query="SELECT *, current_timestamp AS LoadDttm FROM source_table"
query="""SELECT *, current_timestamp AS LoadDttm FROM source_table"""
query='SELECT *, current_timestamp AS LoadDttm FROM source_table'
query=`SELECT *, current_timestamp AS LoadDttm FROM source_table`

Would anyone know any approach for this?有人知道这方面的任何方法吗?

I guess you are looking for a escape sequence in gcloud command(since your job works when launching from gcloud console)我猜您正在 gcloud 命令中寻找转义序列(因为从 gcloud 控制台启动时您的工作有效)

I would recommend going through "gcloud topic escaping" or the following link https://cloud.google.com/sdk/gcloud/reference/topic/escaping我建议通过“gcloud 主题转义”或以下链接https://cloud.google.com/sdk/gcloud/reference/topic/escaping

There are examples to guide you in specifying a delimiter that is not present in your query.有一些示例可以指导您指定查询中不存在的分隔符。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM