Skip to content

Commit

Permalink
docs(tutorials): Add STRUCT column to tutorial (#1534)
Browse files Browse the repository at this point in the history
* docs(tutorials): Add STRUCT column to tutorial

Add a STRUCT column to the JsonWriteDefaultStream tutorial

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Mike Wasson <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 14, 2022
1 parent 43446b2 commit 9595dab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.Field;
import com.google.cloud.bigquery.FieldList;
import com.google.cloud.bigquery.Schema;
import com.google.cloud.bigquery.StandardSQLTypeName;
import com.google.cloud.bigquery.StandardTableDefinition;
Expand Down Expand Up @@ -68,8 +69,12 @@ public static void createDestinationTable(
Field.of("author", StandardSQLTypeName.STRING),
Field.of("committer", StandardSQLTypeName.STRING),
Field.of("commit_date", StandardSQLTypeName.DATETIME),
Field.of("subject", StandardSQLTypeName.STRING),
Field.of("message", StandardSQLTypeName.STRING),
Field.of(
"commit_msg",
StandardSQLTypeName.STRUCT,
FieldList.of(
Field.of("subject", StandardSQLTypeName.STRING),
Field.of("message", StandardSQLTypeName.STRING))),
Field.of("repo_name", StandardSQLTypeName.STRING));

// Create a table that uses this schema.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{"commit":"0001","parent":["00001"],"author":"user1","committer":"GitHub","subject":"Commit 1","message":"This is a commit.\n\n","repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-07-23T20:28:01"}
{"commit":"0002","parent":["00002"],"author":"user1","committer":"GitHub","subject":"Commit 2","message":"This is a commit.\n\n","repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-12-05T16:05:16"}
{"commit":"0003","parent":["00003"],"author":"user1","committer":"GitHub","subject":"Commit 3","message":"This is a commit.\n\n","repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-03-21T16:59:23"}
{"commit":"0004","parent":["00004"],"author":"user1","committer":"GitHub","subject":"Commit 4","message":"This is a commit.\n\n","repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-01-11T01:31:39"}
{"commit":"0005","parent":["00005"],"author":"user1","committer":"GitHub","subject":"Commit 5","message":"This is a commit.\n\n","repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-07-31T19:09:09"}
{"commit":"0001","parent":["00001"],"author":"user1","committer":"GitHub","commit_msg":{"subject":"Commit 1","message":"This is a commit.\n\n"},"repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-07-23T20:28:01"}
{"commit":"0002","parent":["00002"],"author":"user1","committer":"GitHub","commit_msg":{"subject":"Commit 2","message":"This is a commit.\n\n"},"repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-12-05T16:05:16"}
{"commit":"0003","parent":["00003"],"author":"user1","committer":"GitHub","commit_msg":{"subject":"Commit 3","message":"This is a commit.\n\n"},"repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-03-21T16:59:23"}
{"commit":"0004","parent":["00004"],"author":"user1","committer":"GitHub","commit_msg":{"subject":"Commit 4","message":"This is a commit.\n\n"},"repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-01-11T01:31:39"}
{"commit":"0005","parent":["00005"],"author":"user1","committer":"GitHub","commit_msg":{"subject":"Commit 5","message":"This is a commit.\n\n"},"repo_name":"googleapis/java-bigquerystorage","commit_date":"2019-07-31T19:09:09"}

0 comments on commit 9595dab

Please sign in to comment.