File tree Expand file tree Collapse file tree 5 files changed +3
-18
lines changed
google-cloud-bigquery/src
main/java/com/google/cloud/bigquery
test/java/com/google/cloud/bigquery Expand file tree Collapse file tree 5 files changed +3
-18
lines changed Original file line number Diff line number Diff line change 1818
1919import static com .google .common .base .Preconditions .checkNotNull ;
2020
21- import com .google .api .services .bigquery .Bigquery .Jobs .Query ;
22- import com .google .cloud .bigquery .Field .Builder ;
23- import com .google .cloud .bigquery .Field .Mode ;
24- import com .google .cloud .bigquery .Field .Type ;
2521import com .google .common .base .Function ;
2622import com .google .common .base .MoreObjects ;
27- import com .google .common .collect .ImmutableList ;
28- import com .google .common .collect .Lists ;
2923import java .io .Serializable ;
30- import java .util .ArrayList ;
31- import java .util .Arrays ;
32- import java .util .List ;
3324import java .util .Objects ;
3425
3526/**
Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ com.google.api.services.bigquery.model.QueryParameterValue toValuePb() {
394394 com .google .api .services .bigquery .model .QueryParameterValue valuePb =
395395 new com .google .api .services .bigquery .model .QueryParameterValue ();
396396 valuePb .setValue (value );
397- if (arrayValues != null && arrayValues .size () > 0 ) {
397+ if (arrayValues != null && ! arrayValues .isEmpty () ) {
398398 valuePb .setArrayValues (
399399 Lists .transform (arrayValues , QueryParameterValue .TO_VALUE_PB_FUNCTION ));
400400 }
Original file line number Diff line number Diff line change 1919import static com .google .common .base .Preconditions .checkNotNull ;
2020
2121import com .google .common .base .MoreObjects ;
22-
2322import com .google .common .collect .ImmutableList ;
2423import com .google .common .collect .Lists ;
2524import java .io .Serializable ;
2625import java .util .List ;
2726import java .util .Objects ;
28- import javax .annotation .concurrent .Immutable ;
2927
3028/**
3129 * Google Cloud BigQuery Query Request. This class can be used to run a BigQuery SQL query and
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .bigquery ;
1818
19- import static org .junit .Assert .assertArrayEquals ;
2019import static org .junit .Assert .assertEquals ;
2120import static org .junit .Assert .assertNull ;
2221
Original file line number Diff line number Diff line change 7575import com .google .common .collect .ImmutableList ;
7676import com .google .common .collect .ImmutableMap ;
7777import com .google .common .collect .ImmutableSet ;
78+ import com .google .common .collect .Iterables ;
7879import com .google .common .io .BaseEncoding ;
7980import java .io .IOException ;
8081import java .nio .ByteBuffer ;
8990import java .util .logging .Level ;
9091import java .util .logging .Logger ;
9192import org .junit .AfterClass ;
92- import org .junit .Assert ;
9393import org .junit .BeforeClass ;
9494import org .junit .Rule ;
9595import org .junit .Test ;
@@ -860,10 +860,7 @@ public void testNamedQueryParameters() throws InterruptedException {
860860 QueryResponse response = queryAndWaitForResponse (request );
861861 assertEquals (QUERY_RESULT_SCHEMA , response .getResult ().getSchema ());
862862 int rowCount = 0 ;
863- for (List <FieldValue > row : response .getResult ().getValues ()) {
864- rowCount ++;
865- }
866- assertEquals (2 , rowCount );
863+ assertEquals (2 , Iterables .size (response .getResult ().getValues ()));
867864 }
868865
869866 @ Test
You can’t perform that action at this time.
0 commit comments