Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 332B1200D0B for ; Tue, 12 Sep 2017 21:17:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 31B581609C7; Tue, 12 Sep 2017 19:17:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 77AF01609B4 for ; Tue, 12 Sep 2017 21:17:11 +0200 (CEST) Received: (qmail 38718 invoked by uid 500); 12 Sep 2017 19:17:10 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 38708 invoked by uid 99); 12 Sep 2017 19:17:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 19:17:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D9CC418CC55 for ; Tue, 12 Sep 2017 19:17:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id v1lF6YER4dpf for ; Tue, 12 Sep 2017 19:17:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1334D5FB2E for ; Tue, 12 Sep 2017 19:17:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C4531E0C00 for ; Tue, 12 Sep 2017 19:17:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 51C5B24137 for ; Tue, 12 Sep 2017 19:17:00 +0000 (UTC) Date: Tue, 12 Sep 2017 19:17:00 +0000 (UTC) From: "Reuven Lax (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEAM-2761) Write to empty BigQuery partition fails with "No schema specified on job or table." despite having provided schema MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 12 Sep 2017 19:17:12 -0000 [ https://issues.apache.org/jira/browse/BEAM-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163509#comment-16163509 ] Reuven Lax commented on BEAM-2761: ---------------------------------- Hi, I ran the precise job listed in the bug using the latest Beam snapshot, and could not reproduce the failure. BigQuery successfully created an empty table called pets and did not fail with the error. I am going to resolve this issue for now. Please reopen if you can reproduce this on the Beam 2.2.0 snapshots. > Write to empty BigQuery partition fails with "No schema specified on job or table." despite having provided schema > ------------------------------------------------------------------------------------------------------------------ > > Key: BEAM-2761 > URL: https://issues.apache.org/jira/browse/BEAM-2761 > Project: Beam > Issue Type: Bug > Components: runner-dataflow > Affects Versions: 2.1.0, 2.2.0 > Reporter: Fallon > Assignee: Reuven Lax > Priority: Minor > Fix For: 2.2.0 > > Attachments: beam-2761-stacktrace.txt > > > In 2.1.0-SNAPSHOT and 2.2.0-SNAPSHOT, jobs writing an empty PCollection to a BigQuery partition fail with "java.lang.RuntimeException: Failed to create load job with id prefix". This is associated with a message "No schema specified on job or table" even though a schema is provided. See attached stack trace for the more detail on the error. > Command to run job: > {code} > mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.EmptyPCollection \ > -Dexec.args="--runner=DataflowRunner --project= \ > --gcpTempLocation=" \ > -Pdataflow-runner > {code} > Code to reproduce the problem: > {code:title=EmptyPCollection.java|borderStyle=solid} > public class EmptyPCollection { > public static void main(String[] args) { > PipelineOptions options = PipelineOptionsFactory.fromArgs(args).create(); > options.setTempLocation(""); > Pipeline pipeline = Pipeline.create(options); > String schema = "{\"fields\": [{\"name\": \"pet\", \"type\": \"string\", \"mode\": \"required\"}]}"; > String table = "mydataset.pets"; > List pets = Arrays.asList("Dog", "Cat", "Goldfish"); > PCollection inputText = pipeline.apply(Create.of(pets)).setCoder(StringUtf8Coder.of()); > PCollection rows = inputText.apply(ParDo.of(new DoFn() { > @ProcessElement > public void processElement(ProcessContext c) { > String text = c.element(); > if (text.startsWith("X")) { // change to (D)og and works fine > TableRow row = new TableRow(); > row.set("pet", text); > c.output(row); > } > } > })); > rows.apply(BigQueryIO.writeTableRows().to(table).withJsonSchema(schema) > .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND) > .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)); > pipeline.run().waitUntilFinish(); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)