【问题标题】:BigQuery Backend error when reading and writing tables in Dataflow在 Dataflow 中读取和写入表时出现 BigQuery 后端错误
【发布时间】:2016-07-20 07:38:47
【问题描述】:

只有在读取然后写入(到不同的表)时才会出现此错误。如果我只从表中读取,则不会发生错误。例如,下面的代码不会产生错误。

   Pipeline p = Pipeline.create(
    PipelineOptionsFactory.fromArgs(args).withValidation().create());

   PCollection<TableRow> BigQueryTableRow = p
    	.apply(BigQueryIO.Read.named("ReadTable")
        .from("project:dataset.data_table"));

   p.run();

但如果我执行以下操作,我会收到“BigQuery 作业后端错误”。

Pipeline p = Pipeline.create(
    PipelineOptionsFactory.fromArgs(args).withValidation().create());
   PCollection<TableRow> BigQueryTableRow = p
    	.apply(BigQueryIO.Read.named("ReadTable")
        .from("project:dataset.data_table"));


    TableSchema tableSchema = new TableSchema().setFields(fields);
    
    BigQueryTableRow.apply(BigQueryIO.Write
      .named("Write Members to BigQuery")
      .to("project:dataset.data_table_two")
      .withSchema(tableSchema)
      .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE)
      .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED));
        
       p.run();

有关错误的更多详细信息

BigQuery job "dataflow_job" in project "project-name" 
finished with error(s): errorResult: Backend error. 
Job aborted.

【问题讨论】:

  • 请告诉我们您在哪里设置 PipelineOptions
  • 我正在从参数设置管道选项,因为它由 Eclipse 默认创建的“StarterPipeline”类完成。我会把这个添加到我的帖子中。

标签: google-bigquery google-cloud-dataflow


【解决方案1】:

我设法自己解决了问题。产生后端错误消息是因为我的表中有两个重复的字段。

如果我尝试使用 BigQuery 的网络服务输出整个表格,它会显示更多有用的错误消息。

Error: Cannot output multiple independently repeated fields
at the same time. Found memberships_is_coach and actions_type

很遗憾,“后端错误”消息没有提供对问题的真正洞察。此外,当只读取数据而不执行任何操作时,不会给出进一步加剧问题的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-14
    • 1970-01-01
    相关资源
    最近更新 更多