Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 691eae5

Browse files
docs(tutorials): Add README, other small fixes to JsonWriterDefaultStream tutorial (#1504)
- Add a readme file - Fix the POM file for the current directory structure - Change one schema field in the sample
1 parent 79cb548 commit 691eae5

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

tutorials/JsonWriterDefaultStream/JsonWriterDefaultStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static void createDestinationTable(
6767
.build(),
6868
Field.of("author", StandardSQLTypeName.STRING),
6969
Field.of("committer", StandardSQLTypeName.STRING),
70-
Field.of("time_sec", StandardSQLTypeName.INT64),
70+
Field.of("ts", StandardSQLTypeName.DATETIME),
7171
Field.of("subject", StandardSQLTypeName.STRING),
7272
Field.of("message", StandardSQLTypeName.STRING),
7373
Field.of("repo_name", StandardSQLTypeName.STRING));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# BigQuery Write API streaming tutorial
2+
3+
This sample shows how to stream data from a JSON source into BigQuery by using
4+
the [BigQuery Write API](https://cloud.google.com/bigquery/docs/write-api) with
5+
the default stream.
6+
7+
## Usage
8+
9+
Download the
10+
[sample data file](https://storage.googleapis.com/cloud-samples-data/bigquery/tutorials/github.json).
11+
12+
From this directory, run:
13+
14+
```
15+
mvn compile exec:java \
16+
-Dexec.mainClass=com.example.bigquerystorage.JsonWriterDefaultStream \
17+
-Dexec.args="project_id dataset table filepath`
18+
```
19+
20+
where `file_path` is the path to the JSON data file.
21+

tutorials/JsonWriterDefaultStream/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
</goals>
5858
<configuration>
5959
<sources>
60-
<source>src/main/java</source>
61-
<source>../snippets/src/main/java/com/example/bigquerystorage</source>
60+
<source>.</source>
61+
<source>../../samples/snippets/src/main/java/com/example/bigquerystorage</source>
6262
</sources>
6363
</configuration>
6464
</execution>
@@ -81,4 +81,4 @@
8181
</plugin>
8282
</plugins>
8383
</build>
84-
</project>
84+
</project>

0 commit comments

Comments
 (0)