You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Batch extension which contains an `ItemWriter` implementation for https://cloud.google.com/bigquery[BigQuery] based on https://github.com/googleapis/java-bigquery[Java BigQuery]. It supports writing https://en.wikipedia.org/wiki/Comma-separated_values[CSV], https://en.wikipedia.org/wiki/JSON[JSON] using https://cloud.google.com/bigquery/docs/batch-loading-data[load jobs].
3
+
Spring Batch extension which contains an `ItemWriter` implementation for https://cloud.google.com/bigquery[BigQuery] based on https://github.com/googleapis/java-bigquery[Java BigQuery].
4
+
It supports writing https://en.wikipedia.org/wiki/Comma-separated_values[CSV], https://en.wikipedia.org/wiki/JSON[JSON] using https://cloud.google.com/bigquery/docs/batch-loading-data[load jobs].
4
5
5
-
## Configuration of `BigQueryCsvItemWriter`
6
+
==Configuration of `BigQueryCsvItemWriter`
6
7
7
8
Next to the https://docs.spring.io/spring-batch/reference/html/configureJob.html[configuration of Spring Batch] one needs to configure the `BigQueryCsvItemWriter`.
Additional examples could be found in https://github.com/spring-projects/spring-batch-extensions/blob/main/spring-batch-bigquery/src/test/java/org/springframework/batch/extensions/bigquery/writer/builder/[here].
26
28
27
-
## Configuration properties
29
+
== Configuration properties
28
30
[cols="1,1,4"]
29
-
.Properties for item writer
31
+
.Properties for an item writer
30
32
|===
31
33
| Property | Required | Description
32
34
33
35
| `bigQuery` | yes | BigQuery object that provided by BigQuery Java Library. Responsible for connection with BigQuery.
34
36
| `writeChannelConfig` | yes | BigQuery write channel config provided by BigQuery Java Library. Responsible for configuring data type, data channel, jobs that will be sent to BigQuery.
35
-
| `rowMapper` | no | Your own converter that specifies how to convert input CSV / JSON to byte array.
36
-
| `datasetInfo` | no | Your way to customize to how to create BigQuery dataset.
37
+
| `rowMapper` | no | Your own converter that specifies how to convert input CSV / JSON to a byte array.
38
+
| `datasetInfo` | no | Your way to customize how to create BigQuery dataset.
37
39
| `jobConsumer` | no | Your custom handler for BigQuery Job provided by BigQuery Java Library.
Copy file name to clipboardExpand all lines: spring-batch-bigquery/src/main/java/org/springframework/batch/extensions/bigquery/reader/BigQueryQueryItemReader.java
+4-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2023 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
27
27
importorg.springframework.util.Assert;
28
28
29
29
importjava.util.Iterator;
30
-
importjava.util.Objects;
31
30
32
31
/**
33
32
* BigQuery {@link ItemReader} that accepts simple query as the input.
@@ -37,7 +36,7 @@
37
36
* <p>
38
37
* Also, worth mentioning that you should take into account concurrency limits.
39
38
* <p>
40
-
* Results of this query by default are stored in a shape of temporary table.
39
+
* Results of this query by default are stored in the shape of a temporary table.
41
40
*
42
41
* @param <T> your DTO type
43
42
* @author Volodymyr Perebykivskyi
@@ -84,7 +83,7 @@ public void setJobConfiguration(QueryJobConfiguration jobConfiguration) {
84
83
85
84
@Override
86
85
publicTread() throwsException {
87
-
if (Objects.isNull(iterator)) {
86
+
if (iterator == null) {
88
87
doOpen();
89
88
}
90
89
@@ -109,4 +108,4 @@ public void afterPropertiesSet() {
109
108
Assert.notNull(this.jobConfiguration, "Job configuration must be provided");
Copy file name to clipboardExpand all lines: spring-batch-bigquery/src/main/java/org/springframework/batch/extensions/bigquery/reader/builder/BigQueryQueryItemReaderBuilder.java
+7-9
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2023 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-batch-bigquery/src/main/java/org/springframework/batch/extensions/bigquery/writer/BigQueryBaseItemWriter.java
+15-16
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2023 the original author or authors.
2
+
* Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@ public abstract class BigQueryBaseItemWriter<T> implements ItemWriter<T> {
0 commit comments