Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(tutorials): Add README, other small fixes to JsonWriterDefaultStream tutorial #1504

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static void createDestinationTable(
.build(),
Field.of("author", StandardSQLTypeName.STRING),
Field.of("committer", StandardSQLTypeName.STRING),
Field.of("time_sec", StandardSQLTypeName.INT64),
Field.of("ts", StandardSQLTypeName.DATETIME),
Field.of("subject", StandardSQLTypeName.STRING),
Field.of("message", StandardSQLTypeName.STRING),
Field.of("repo_name", StandardSQLTypeName.STRING));
Expand Down
21 changes: 21 additions & 0 deletions tutorials/JsonWriterDefaultStream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# BigQuery Write API streaming tutorial

This sample shows how to stream data from a JSON source into BigQuery by using
the [BigQuery Write API](https://cloud.google.com/bigquery/docs/write-api) with
the default stream.

## Usage

Download the
[sample data file](https://storage.googleapis.com/cloud-samples-data/bigquery/tutorials/github.json).

From this directory, run:

```
mvn compile exec:java \
-Dexec.mainClass=com.example.bigquerystorage.JsonWriterDefaultStream \
-Dexec.args="project_id dataset table filepath`
```

where `file_path` is the path to the JSON data file.

6 changes: 3 additions & 3 deletions tutorials/JsonWriterDefaultStream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</goals>
<configuration>
<sources>
<source>src/main/java</source>
<source>../snippets/src/main/java/com/example/bigquerystorage</source>
<source>.</source>
<source>../../samples/snippets/src/main/java/com/example/bigquerystorage</source>
</sources>
</configuration>
</execution>
Expand All @@ -81,4 +81,4 @@
</plugin>
</plugins>
</build>
</project>
</project>