|
1 | 1 | # Getting Started with BigQuery and the Google Java API Client library |
2 | 2 |
|
3 | | -<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=README.md&cloudshell_working_dir=bigquery/cloud-client/"> |
4 | | -<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> |
5 | | - |
6 | | -[Google's BigQuery Service][BigQuery] features a REST-based API that allows |
7 | | -developers to create applications to run ad-hoc queries on massive datasets. |
8 | | -These sample Java applications demonstrate how to access the BigQuery API using |
9 | | -the [Google Cloud Client Library for Java][google-cloud-java]. |
10 | | - |
11 | | -[BigQuery]: https://cloud.google.com/bigquery/ |
12 | | -[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java |
13 | | - |
14 | | -## Quickstart |
15 | | - |
16 | | -Install [Maven](http://maven.apache.org/). |
17 | | - |
18 | | -[Authenticate using a service account](https://cloud.google.com/docs/authentication/getting-started). |
19 | | -Create a service account, download a JSON key file, and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable. |
20 | | - |
21 | | -Build your project with: |
22 | | - |
23 | | - mvn clean package -DskipTests |
24 | | - |
25 | | -You can then run a given `ClassName` via: |
26 | | - |
27 | | - mvn exec:java -Dexec.mainClass=com.example.bigquery.ClassName \ |
28 | | - -DpropertyName=propertyValue \ |
29 | | - -Dexec.args="any arguments to the app" |
30 | | - |
31 | | -### Creating a new dataset (using the quickstart sample) |
32 | | - |
33 | | - mvn exec:java -Dexec.mainClass=com.example.bigquery.QuickstartSample |
34 | | - |
35 | | -### Running a query using standard SQL syntax |
36 | | - |
37 | | - mvn exec:java -Dexec.mainClass=com.example.bigquery.QuerySample \ |
38 | | - -Dexec.args=' \ |
39 | | - --query="SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;" \ |
40 | | - --runStandardSqlQuery' |
41 | | - |
42 | | -### Running the simple app example |
43 | | - |
44 | | -To run the example from the [simple app example |
45 | | -documentation](https://cloud.google.com/bigquery/create-simple-app-api): |
46 | | - |
47 | | - mvn exec:java -Dexec.mainClass=com.example.bigquery.SimpleApp |
48 | | - |
| 3 | +This sample has moved to a new location: |
| 4 | +https://github.com/googleapis/java-bigquery/tree/master/samples |
0 commit comments