0

我关注了 Marton 的这篇非常有用的文章https://martonkodok.medium.com/automate-the-execution-of-bigquery-queries-with-cloud-workflows-9fffe0557dbb使用云工作流和其他工具自动执行大查询文章https://medium.com/codeshake/build-a-serverless-bigquery-ingestion-pipeline-using-cloud-workflows-f893f6b701ee

我能够使用简单的 sql 查询创建工作流。但是,在执行该过程时出现如下错误。

'query' is string; want dict
in step "InvokeProdcedure", routine "main", line: 9
{
  "message": "'query' is string; want dict",
  "tags": [
    "TypeError"
  ]
}

下面是一个非常简单的代码,我在其中调用了一个过程。

# This is a sample workflow to test or replace with your source code.
#
# This workflow returns a list of Wikipedia articles related to a search term.
# The search term is retrieved from a Cloud Function that returns the current day of the week
# (in GMT), unless a search term is given as input (e.g. {"searchTerm": "Monday"}).
main:
    steps:
    - InvokeProdcedure:
        call: googleapis.bigquery.v2.jobs.query
        args:
            projectId: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
            query:  >
                  DECLARE source_dataset_name STRING DEFAULT NULL;
                  DECLARE source_table_name STRING DEFAULT NULL;
                  DECLARE destination_dataset_name STRING DEFAULT NULL;
                  DECLARE destination_table_name STRING DEFAULT NULL;
                  DECLARE recordstamp_column_name STRING DEFAULT NULL;
                  DECLARE flag_column_name STRING DEFAULT NULL;
                  DECLARE is_deleted_column_name STRING DEFAULT NULL;
                  DECLARE pk_colmun_name_list ARRAY<STRING> DEFAULT NULL;
                  CALL `project.dataset.procedure_name`(*Values passed for all variables above)
        result: queryResult

我在这里做错了什么。这不是在云工作流中调用过程的正确方法吗?

4

1 回答 1

0

我能够解决这个问题。出现语法错误。我的代码中缺少正文。请参阅下面的谷歌文档。

在此处输入图像描述

于 2021-06-29T09:02:56.750 回答