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

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

                Author: ASF GitHub Bot
            Created on: 07/Nov/18 17:26
            Start Date: 07/Nov/18 17:26
    Worklog Time Spent: 10m 
      Work Description: lgajowy commented on a change in pull request #6886: 
[BEAM-5906] Use dedicated BigQuery client for publishing Nexmark results
URL: https://github.com/apache/beam/pull/6886#discussion_r231601163
 
 

 ##########
 File path: 
sdks/java/testing/nexmark/src/test/java/org/apache/beam/sdk/nexmark/PerfsToBigQueryTest.java
 ##########
 @@ -87,41 +71,47 @@ public void testSavePerfsToBigQuery() throws IOException, 
InterruptedException {
     nexmarkPerf2.eventsPerSec = 1.5F;
     nexmarkPerf2.runtimeSec = 1.325F;
 
-    // simulate 2 runs of the same query just to check that rows are apened 
correctly.
+    // simulate 2 runs of the same query just to check that rows are appended 
correctly.
     HashMap<NexmarkConfiguration, NexmarkPerf> perfs = new HashMap<>(2);
     perfs.put(nexmarkConfiguration1, nexmarkPerf1);
     perfs.put(nexmarkConfiguration2, nexmarkPerf2);
 
-    // cast to int due to BEAM-4734. To avoid overflow on int capacity,
-    // set the instant to a fixed date (and not Instant.now())
-    int startTimestampSeconds = 1454284800;
-    Main.savePerfsToBigQuery(
-        options, perfs, fakeBqServices, new Instant(startTimestampSeconds * 
1000L));
-
-    String tableSpec = NexmarkUtils.tableSpec(options, 
QUERY.getNumberOrName(), 0L, null);
-    List<TableRow> actualRows =
-        fakeDatasetService.getAllRows(
-            options.getProject(),
-            options.getBigQueryDataset(),
-            BigQueryHelpers.parseTableSpec(tableSpec).getTableId());
-    assertEquals("Wrong number of rows inserted", 2, actualRows.size());
-    List<TableRow> expectedRows = new ArrayList<>();
-    TableRow row1 =
-        new TableRow()
-            .set("timestamp", startTimestampSeconds)
-            .set("runtimeSec", nexmarkPerf1.runtimeSec)
-            .set("eventsPerSec", nexmarkPerf1.eventsPerSec)
-            // cast to int due to BEAM-4734.
-            .set("numResults", (int) nexmarkPerf1.numResults);
-    expectedRows.add(row1);
-    TableRow row2 =
-        new TableRow()
-            .set("timestamp", startTimestampSeconds)
-            .set("runtimeSec", nexmarkPerf2.runtimeSec)
-            .set("eventsPerSec", nexmarkPerf2.eventsPerSec)
-            // cast to int  due to BEAM-4734.
-            .set("numResults", (int) nexmarkPerf2.numResults);
-    expectedRows.add(row2);
-    assertThat(actualRows, containsInAnyOrder(Iterables.toArray(expectedRows, 
TableRow.class)));
+    long startTimestampSeconds = 1454284800000L;
 
 Review comment:
   ok

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 163516)
    Time Spent: 2h 20m  (was: 2h 10m)

> Remove pipeline for publishing nexmark results to bigQuery and publish using 
> BigQuery API only
> ----------------------------------------------------------------------------------------------
>
>                 Key: BEAM-5906
>                 URL: https://issues.apache.org/jira/browse/BEAM-5906
>             Project: Beam
>          Issue Type: Improvement
>          Components: examples-nexmark
>            Reporter: Lukasz Gajowy
>            Assignee: Lukasz Gajowy
>            Priority: Minor
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> There's no need to start a separate pipeline for uploading metrics results 
> from Nexmark suites to BigQuery. We can use an API designed for that and 
> place it in test-utils. Thanks to that: 
>  - it won't start a separate pipeline every time it publishes results
>  - other suites will be able to use that code
>  - We will not face problems like special long to int conversion due to 
> problems in BigQueryIO (eg. BEAM-4734) because we will use a thin API instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to