[ 
https://issues.apache.org/jira/browse/BEAM-9411?focusedWorklogId=400313&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-400313
 ]

ASF GitHub Bot logged work on BEAM-9411:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Mar/20 18:53
            Start Date: 09/Mar/20 18:53
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on pull request #11003: 
[BEAM-9411] Enable BigQuery DIRECT_READ by default in SQL
URL: https://github.com/apache/beam/pull/11003#discussion_r389893825
 
 

 ##########
 File path: 
sdks/java/extensions/sql/datacatalog/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogBigQueryIT.java
 ##########
 @@ -69,9 +73,18 @@
 
     @Test
     public void testRead() throws Exception {
-      bigQuery.insertRows(ID_NAME_SCHEMA, row(1, "name1"), row(2, "name2"), 
row(3, "name3"));
-
       TableReference bqTable = bigQuery.tableReference();
+
+      // Streaming inserts do not work with DIRECT_READ mode, there is a 
several hour lag.
+      PCollection<Row> data =
+          writePipeline.apply(Create.of(row(1, "name1"), row(2, "name2"), 
row(3, "name3")));
+      data.apply(
+          BigQueryIO.<Row>write()
+              .withSchema(BigQueryUtils.toTableSchema(ID_NAME_SCHEMA))
+              .withFormatFunction(BigQueryUtils.toTableRow())
 
 Review comment:
   I would suggest to add `.withMethod(Method.FILE_LOADS)` to be explicit. It 
connects it better with the comment above. And is protected in case the default 
changes.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 400313)
    Time Spent: 3h 10m  (was: 3h)

> Use BigQuery DIRECT_READ by default for SQL
> -------------------------------------------
>
>                 Key: BEAM-9411
>                 URL: https://issues.apache.org/jira/browse/BEAM-9411
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>            Reporter: Andrew Pilloud
>            Assignee: Andrew Pilloud
>            Priority: Major
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> The BigQuery DIRECT_READ mode is available globally as of January 17, we 
> should enable it by default!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to