diff --git a/tutorials/JsonWriterDefaultStream/JsonWriterDefaultStream.java b/tutorials/JsonWriterDefaultStream/JsonWriterDefaultStream.java index 18eebcba4f..70d5da08c8 100644 --- a/tutorials/JsonWriterDefaultStream/JsonWriterDefaultStream.java +++ b/tutorials/JsonWriterDefaultStream/JsonWriterDefaultStream.java @@ -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)); diff --git a/tutorials/JsonWriterDefaultStream/README.md b/tutorials/JsonWriterDefaultStream/README.md new file mode 100644 index 0000000000..d4201d953f --- /dev/null +++ b/tutorials/JsonWriterDefaultStream/README.md @@ -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. + diff --git a/tutorials/JsonWriterDefaultStream/pom.xml b/tutorials/JsonWriterDefaultStream/pom.xml index 91a27d2351..c17f8e3641 100644 --- a/tutorials/JsonWriterDefaultStream/pom.xml +++ b/tutorials/JsonWriterDefaultStream/pom.xml @@ -57,8 +57,8 @@ - src/main/java - ../snippets/src/main/java/com/example/bigquerystorage + . + ../../samples/snippets/src/main/java/com/example/bigquerystorage @@ -81,4 +81,4 @@ - \ No newline at end of file +