Skip to content

Commit

Permalink
docs(tutorials): Add README, other small fixes to JsonWriterDefaultSt…
Browse files Browse the repository at this point in the history
…ream tutorial (#1504)

- Add a readme file
- Fix the POM file for the current directory structure
- Change one schema field in the sample
  • Loading branch information
VeronicaWasson authored Feb 2, 2022
1 parent 79cb548 commit 691eae5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
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`

This comment has been minimized.

Copy link
@suztomo

suztomo Feb 2, 2022

Member

double-quote at the end?

This comment has been minimized.

Copy link
@suztomo

suztomo Feb 2, 2022

Member

"file_path"? Because line 20 mentions that.

```

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>

0 comments on commit 691eae5

Please sign in to comment.