| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e0245f6 commit 398f9c3
49 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ | |||
| 53 | 53 | <dependency> | |
| 54 | 54 | <groupId>org.apache.httpcomponents</groupId> | |
| 55 | 55 | <artifactId>httpclient</artifactId> | |
| 56 | - <version>4.5.4</version> | ||
| 56 | + <version>4.5.5</version> | ||
| 57 | 57 | </dependency> | |
| 58 | 58 | ||
| 59 | 59 | <dependency> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ | |||
| 72 | 72 | <dependency> | |
| 73 | 73 | <groupId>org.postgresql</groupId> | |
| 74 | 74 | <artifactId>postgresql</artifactId> | |
| 75 | - <version>42.1.4.jre7</version> | ||
| 75 | + <version>42.2.0</version> | ||
| 76 | 76 | </dependency> | |
| 77 | 77 | ||
| 78 | 78 | <dependency> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,7 @@ | |||
| 65 | 65 | <dependency> | |
| 66 | 66 | <groupId>com.google.cloud</groupId> | |
| 67 | 67 | <artifactId>google-cloud</artifactId> | |
| 68 | - <version>0.32.0-alpha</version> | ||
| 68 | + <version>0.33.0-alpha</version> | ||
| 69 | 69 | </dependency> | |
| 70 | 70 | ||
| 71 | 71 | <dependency> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,12 +52,12 @@ | |||
| 52 | 52 | <dependency> | |
| 53 | 53 | <groupId>com.google.cloud</groupId> | |
| 54 | 54 | <artifactId>google-cloud-pubsub</artifactId> | |
| 55 | - <version>0.32.0-beta</version> | ||
| 55 | + <version>0.33.0-beta</version> | ||
| 56 | 56 | </dependency> | |
| 57 | 57 | <dependency> | |
| 58 | 58 | <groupId>com.google.cloud</groupId> | |
| 59 | 59 | <artifactId>google-cloud-datastore</artifactId> | |
| 60 | - <version>1.14.0</version> | ||
| 60 | + <version>1.15.0</version> | ||
| 61 | 61 | </dependency> | |
| 62 | 62 | <!-- [END dependencies] --> | |
| 63 | 63 | </dependencies> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ | |||
| 44 | 44 | <dependency> | |
| 45 | 45 | <groupId>org.apache.httpcomponents</groupId> | |
| 46 | 46 | <artifactId>httpclient</artifactId> | |
| 47 | - <version>4.5.4</version> | ||
| 47 | + <version>4.5.5</version> | ||
| 48 | 48 | </dependency> | |
| 49 | 49 | ||
| 50 | 50 | <dependency> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ | |||
| 44 | 44 | <dependency> | |
| 45 | 45 | <groupId>com.google.cloud</groupId> | |
| 46 | 46 | <artifactId>google-cloud-spanner</artifactId> | |
| 47 | - <version>0.32.0-beta</version> | ||
| 47 | + <version>0.33.0-beta</version> | ||
| 48 | 48 | </dependency> | |
| 49 | 49 | <dependency> | |
| 50 | 50 | <groupId>javax.servlet</groupId> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ | |||
| 44 | 44 | <dependency> | |
| 45 | 45 | <groupId>org.apache.httpcomponents</groupId> | |
| 46 | 46 | <artifactId>httpclient</artifactId> | |
| 47 | - <version>4.5.4</version> | ||
| 47 | + <version>4.5.5</version> | ||
| 48 | 48 | </dependency> | |
| 49 | 49 | <dependency> | |
| 50 | 50 | <groupId>javax.servlet</groupId> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ | |||
| 44 | 44 | <dependency> | |
| 45 | 45 | <groupId>org.apache.httpcomponents</groupId> | |
| 46 | 46 | <artifactId>httpclient</artifactId> | |
| 47 | - <version>4.5.4</version> | ||
| 47 | + <version>4.5.5</version> | ||
| 48 | 48 | </dependency> | |
| 49 | 49 | <dependency> | |
| 50 | 50 | <groupId>javax.servlet</groupId> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ | |||
| 40 | 40 | <dependency> | |
| 41 | 41 | <groupId>com.google.cloud</groupId> | |
| 42 | 42 | <artifactId>google-cloud-bigquery</artifactId> | |
| 43 | - <version>0.32.0-beta</version> | ||
| 43 | + <version>0.33.0-beta</version> | ||
| 44 | 44 | </dependency> | |
| 45 | 45 | <!-- [END dependencies] --> | |
| 46 | 46 | <dependency> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,8 +21,7 @@ | |||
| 21 | 21 | import com.google.cloud.bigquery.FieldValue; | |
| 22 | 22 | import com.google.cloud.bigquery.QueryJobConfiguration; | |
| 23 | 23 | import com.google.cloud.bigquery.QueryParameterValue; | |
| 24 | - import com.google.cloud.bigquery.QueryResponse; | ||
| 25 | - import com.google.cloud.bigquery.QueryResult; | ||
| 24 | + import com.google.cloud.bigquery.TableResult; | ||
| 26 | 25 | import java.io.IOException; | |
| 27 | 26 | import java.util.Arrays; | |
| 28 | 27 | import java.util.List; | |
@@ -112,8 +111,7 @@ public static void main(final String[] args) throws IOException, InterruptedExce | |||
| 112 | 111 | // [START bigquery_query_params] | |
| 113 | 112 | private static void runNamed(final String corpus, final long minWordCount) | |
| 114 | 113 | throws InterruptedException { | |
| 115 | - BigQuery bigquery = | ||
| 116 | - new BigQueryOptions.DefaultBigqueryFactory().create(BigQueryOptions.getDefaultInstance()); | ||
| 114 | + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); | ||
| 117 | 115 | ||
| 118 | 116 | String queryString = | |
| 119 | 117 | "SELECT word, word_count\n" | |
@@ -131,25 +129,9 @@ private static void runNamed(final String corpus, final long minWordCount) | |||
| 131 | 129 | .build(); | |
| 132 | 130 | ||
| 133 | 131 | // Execute the query. | |
| 134 | - QueryResponse response = bigquery.query(queryRequest); | ||
| 135 | - | ||
| 136 | - // Wait for the job to finish (if the query takes more than 10 seconds to complete). | ||
| 137 | - while (!response.jobCompleted()) { | ||
| 138 | - Thread.sleep(1000); | ||
| 139 | - response = bigquery.getQueryResults(response.getJobId()); | ||
| 140 | - } | ||
| 141 | - | ||
| 142 | - // Check for errors. | ||
| 143 | - if (response.hasErrors()) { | ||
| 144 | - String firstError = ""; | ||
| 145 | - if (response.getExecutionErrors().size() != 0) { | ||
| 146 | - firstError = response.getExecutionErrors().get(0).getMessage(); | ||
| 147 | - } | ||
| 148 | - throw new RuntimeException(firstError); | ||
| 149 | - } | ||
| 132 | + TableResult result = bigquery.query(queryRequest); | ||
| 150 | 133 | ||
| 151 | 134 | // Print all pages of the results. | |
| 152 | - QueryResult result = response.getResult(); | ||
| 153 | 135 | while (result != null) { | |
| 154 | 136 | for (List<FieldValue> row : result.iterateAll()) { | |
| 155 | 137 | System.out.printf("%s: %d\n", row.get(0).getStringValue(), row.get(1).getLongValue()); | |
@@ -165,8 +147,7 @@ private static void runNamed(final String corpus, final long minWordCount) | |||
| 165 | 147 | */ | |
| 166 | 148 | // [START bigquery_query_params_arrays] | |
| 167 | 149 | private static void runArray(String gender, String[] states) throws InterruptedException { | |
| 168 | - BigQuery bigquery = | ||
| 169 | - new BigQueryOptions.DefaultBigqueryFactory().create(BigQueryOptions.getDefaultInstance()); | ||
| 150 | + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); | ||
| 170 | 151 | ||
| 171 | 152 | String queryString = | |
| 172 | 153 | "SELECT name, sum(number) as count\n" | |
@@ -186,25 +167,9 @@ private static void runArray(String gender, String[] states) throws InterruptedE | |||
| 186 | 167 | .build(); | |
| 187 | 168 | ||
| 188 | 169 | // Execute the query. | |
| 189 | - QueryResponse response = bigquery.query(queryRequest); | ||
| 190 | - | ||
| 191 | - // Wait for the job to finish (if the query takes more than 10 seconds to complete). | ||
| 192 | - while (!response.jobCompleted()) { | ||
| 193 | - Thread.sleep(1000); | ||
| 194 | - response = bigquery.getQueryResults(response.getJobId()); | ||
| 195 | - } | ||
| 196 | - | ||
| 197 | - // Check for errors. | ||
| 198 | - if (response.hasErrors()) { | ||
| 199 | - String firstError = ""; | ||
| 200 | - if (response.getExecutionErrors().size() != 0) { | ||
| 201 | - firstError = response.getExecutionErrors().get(0).getMessage(); | ||
| 202 | - } | ||
| 203 | - throw new RuntimeException(firstError); | ||
| 204 | - } | ||
| 170 | + TableResult result = bigquery.query(queryRequest); | ||
| 205 | 171 | ||
| 206 | 172 | // Print all pages of the results. | |
| 207 | - QueryResult result = response.getResult(); | ||
| 208 | 173 | while (result != null) { | |
| 209 | 174 | for (List<FieldValue> row : result.iterateAll()) { | |
| 210 | 175 | System.out.printf("%s: %d\n", row.get(0).getStringValue(), row.get(1).getLongValue()); | |
@@ -217,8 +182,7 @@ private static void runArray(String gender, String[] states) throws InterruptedE | |||
| 217 | 182 | ||
| 218 | 183 | // [START bigquery_query_params_timestamps] | |
| 219 | 184 | private static void runTimestamp() throws InterruptedException { | |
| 220 | - BigQuery bigquery = | ||
| 221 | - new BigQueryOptions.DefaultBigqueryFactory().create(BigQueryOptions.getDefaultInstance()); | ||
| 185 | + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); | ||
| 222 | 186 | ||
| 223 | 187 | DateTime timestamp = new DateTime(2016, 12, 7, 8, 0, 0, DateTimeZone.UTC); | |
| 224 | 188 | ||
@@ -236,25 +200,9 @@ private static void runTimestamp() throws InterruptedException { | |||
| 236 | 200 | .build(); | |
| 237 | 201 | ||
| 238 | 202 | // Execute the query. | |
| 239 | - QueryResponse response = bigquery.query(queryRequest); | ||
| 240 | - | ||
| 241 | - // Wait for the job to finish (if the query takes more than 10 seconds to complete). | ||
| 242 | - while (!response.jobCompleted()) { | ||
| 243 | - Thread.sleep(1000); | ||
| 244 | - response = bigquery.getQueryResults(response.getJobId()); | ||
| 245 | - } | ||
| 246 | - | ||
| 247 | - // Check for errors. | ||
| 248 | - if (response.hasErrors()) { | ||
| 249 | - String firstError = ""; | ||
| 250 | - if (response.getExecutionErrors().size() != 0) { | ||
| 251 | - firstError = response.getExecutionErrors().get(0).getMessage(); | ||
| 252 | - } | ||
| 253 | - throw new RuntimeException(firstError); | ||
| 254 | - } | ||
| 203 | + TableResult result = bigquery.query(queryRequest); | ||
| 255 | 204 | ||
| 256 | 205 | // Print all pages of the results. | |
| 257 | - QueryResult result = response.getResult(); | ||
| 258 | 206 | DateTimeFormatter formatter = ISODateTimeFormat.dateTimeNoMillis().withZoneUTC(); | |
| 259 | 207 | while (result != null) { | |
| 260 | 208 | for (List<FieldValue> row : result.iterateAll()) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments