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 A5A8B20049E for ; Thu, 10 Aug 2017 19:40:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A449116BC61; Thu, 10 Aug 2017 17:40:04 +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 EB59316BC5E for ; Thu, 10 Aug 2017 19:40:03 +0200 (CEST) Received: (qmail 37689 invoked by uid 500); 10 Aug 2017 17:40:03 -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 37680 invoked by uid 99); 10 Aug 2017 17:40:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Aug 2017 17:40:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 93B5CC023E for ; Thu, 10 Aug 2017 17:40:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id rSehlQlPtzNj for ; Thu, 10 Aug 2017 17:40:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6385C5F6C4 for ; Thu, 10 Aug 2017 17:40:00 +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 7BB2FE0732 for ; Thu, 10 Aug 2017 17:40: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 3085823E7B for ; Thu, 10 Aug 2017 17:40:00 +0000 (UTC) Date: Thu, 10 Aug 2017 17:40:00 +0000 (UTC) From: "Fallon (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (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: Thu, 10 Aug 2017 17:40:04 -0000 [ https://issues.apache.org/jira/browse/BEAM-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fallon updated BEAM-2761: ------------------------- Attachment: beam-2761-stacktrace.txt > 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: Thomas Groh > Priority: Minor > 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. > 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)