From commits-return-61061-archive-asf-public=cust-asf.ponee.io@beam.apache.org Wed Mar 14 22:14:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CE3FD18067B for ; Wed, 14 Mar 2018 22:14:05 +0100 (CET) Received: (qmail 35167 invoked by uid 500); 14 Mar 2018 21:14:04 -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 35158 invoked by uid 99); 14 Mar 2018 21:14:04 -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; Wed, 14 Mar 2018 21:14:04 +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 3AB4118197F for ; Wed, 14 Mar 2018 21:14:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, 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 G98a0goaIkag for ; Wed, 14 Mar 2018 21:14:02 +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 0C5E05F5FA for ; Wed, 14 Mar 2018 21:14: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 EAE26E0CF1 for ; Wed, 14 Mar 2018 21:14: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 5DA1E21496 for ; Wed, 14 Mar 2018 21:14:00 +0000 (UTC) Date: Wed, 14 Mar 2018 21:14:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (BEAM-2817) Bigquery queries should allow options to run in batch mode or not MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEAM-2817?focusedWorklogId=3D8= 0562&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpane= l#worklog-80562 ] ASF GitHub Bot logged work on BEAM-2817: ---------------------------------------- Author: ASF GitHub Bot Created on: 14/Mar/18 21:13 Start Date: 14/Mar/18 21:13 Worklog Time Spent: 10m=20 Work Description: jkff commented on a change in pull request #4606: [= BEAM-2817] BigQuery queries are allowed to run in either BATCH or IN=E2=80= =A6 URL: https://github.com/apache/beam/pull/4606#discussion_r174611761 =20 =20 ########## File path: sdks/java/io/google-cloud-platform/src/test/java/org/apache/bea= m/sdk/io/gcp/bigquery/BigQueryIOReadTest.java ########## @@ -376,6 +377,124 @@ public void processElement(ProcessContext c) throws = Exception { p.run(); } =20 + @Test + public void testReadFromTableInteractive() + throws IOException, InterruptedException { + Table sometable =3D new Table(); + sometable.setSchema( + new TableSchema() + .setFields( + ImmutableList.of( + new TableFieldSchema().setName("name").setType("STRING= "), + new TableFieldSchema().setName("number").setType("INTE= GER")))); + sometable.setTableReference( + new TableReference() + .setProjectId("non-executing-project") + .setDatasetId("somedataset") + .setTableId("sometable")); + sometable.setNumBytes(1024L * 1024L); + FakeDatasetService fakeDatasetService =3D new FakeDatasetService(); + fakeDatasetService.createDataset("non-executing-project", "somedataset= ", "", "", null); + fakeDatasetService.createTable(sometable); + + List records =3D Lists.newArrayList( + new TableRow().set("name", "a").set("number", 1L), + new TableRow().set("name", "b").set("number", 2L), + new TableRow().set("name", "c").set("number", 3L)); + fakeDatasetService.insertAll(sometable.getTableReference(), records, n= ull); + + FakeBigQueryServices fakeBqServices =3D new FakeBigQueryServices() + .withJobService(new FakeJobService()) + .withDatasetService(fakeDatasetService); + + PTransform> readTransform; + BigQueryIO.TypedRead read =3D + BigQueryIO.readTableRows() + .from("non-executing-project:somedataset.sometable") + .withTestServices(fakeBqServices) + .withoutValidation() + .usingInteractivePriority(); + readTransform =3D read; + + PCollection> output =3D + p.apply(readTransform) + .apply( + ParDo.of( + new DoFn>() { + @ProcessElement + public void processElement(ProcessContext c) throws = Exception { + c.output( + KV.of( + (String) c.element().get("name"), + Long.valueOf((String) c.element().get("num= ber")))); + } + })); + + PAssert.that(output) + .containsInAnyOrder(ImmutableList.of(KV.of("a", 1L), KV.of("b", 2L= ), KV.of("c", 3L))); + assertEquals(read.getPriority(), BigQueryIO.TypedRead.Priority.INTERAC= TIVE); =20 Review comment: Unfortunately this doesn't actually do anything, and the tests are vacuo= us (pass without verifying what they are supposed to verify). =20 `read.getPriority()` simply returns what you set on `.usingInteractivePr= iority()` - you need to be verifying the priority that was used on the actu= al BigQuery load job. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 80562) Time Spent: 2h (was: 1h 50m) > Bigquery queries should allow options to run in batch mode or not > ----------------------------------------------------------------- > > Key: BEAM-2817 > URL: https://issues.apache.org/jira/browse/BEAM-2817 > Project: Beam > Issue Type: Bug > Components: io-java-gcp > Affects Versions: 2.0.0 > Reporter: Lara Schmidt > Assignee: Justin Tumale > Priority: Major > Labels: newbie, starter > Fix For: 2.4.0 > > Time Spent: 2h > Remaining Estimate: 0h > > When bigquery read does a query it sets the mode to batch. A batch query = can be very slow to schedule as it batches it with other queries. However i= t doesn't use batch quota which is better for some cases. However, in some = cases a fast query is better (especially in timed tests). It would be a goo= d idea to have a configuration to the bigquery source to set this per-read. -- This message was sent by Atlassian JIRA (v7.6.3#76005)