Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5276648
Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.2
dependabot[bot] Oct 3, 2025
a2d1c9a
Bump org.mockito:mockito-core from 5.17.0 to 5.20.0
dependabot[bot] Sep 22, 2025
8ef6e50
Bump org.apache.maven.plugins:maven-compiler-plugin
dependabot[bot] Sep 22, 2025
5929329
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.12.0
dependabot[bot] Sep 22, 2025
c7f53ca
Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.7 to 3.2.8
dependabot[bot] Jul 3, 2025
489a0a5
Bump org.codehaus.mojo:build-helper-maven-plugin from 3.6.0 to 3.6.1
dependabot[bot] Jun 5, 2025
ea7e26a
Bump org.apache.maven.plugins:maven-project-info-reports-plugin
dependabot[bot] Feb 27, 2025
8e4a759
Bump PostgreSQL JDBC driver from 42.7.4 to 42.7.7
labianchin Apr 7, 2026
50dd3dc
Bump Avro from 1.11.4 to 1.11.5
labianchin Apr 7, 2026
94307a9
Bump Apache Beam SDK from 2.65.0 to 2.72.0
labianchin Apr 7, 2026
8f94e32
Bump Jackson from 2.15.4 to 2.18.2
labianchin Apr 7, 2026
56ed88f
Bump Guava from 33.1.0-jre to 33.5.0-jre
labianchin Apr 7, 2026
1526fa0
Bump PostgreSQL JDBC driver from 42.7.7 to 42.7.8
labianchin Apr 7, 2026
46e5248
Bump google-api-services-cloudkms from v1-rev20240314 to v1-rev20260319
labianchin Apr 7, 2026
d111180
Bump MariaDB JDBC driver from 3.5.3 to 3.5.8
labianchin Apr 7, 2026
998d2c9
Bump zstd-jni from 1.5.6-3 to 1.5.7-7
labianchin Apr 7, 2026
ad07d12
Bump Cloud SQL socket factory from 1.18.0 to 1.25.0
labianchin Apr 7, 2026
900fc1a
Update avro-tools download URL to 1.11.5 in CI workflow
labianchin Apr 7, 2026
067cc76
Bump Apache Beam SDK from 2.72.0 to 2.73.0
labianchin May 4, 2026
e02a1e2
Bump BouncyCastle from 1.78.1 to 1.84
labianchin May 4, 2026
e589677
Bump Checkstyle from 10.23.0 to 10.26.1
labianchin May 4, 2026
09af448
Bump maven-surefire-plugin from 3.5.3 to 3.5.5
labianchin May 4, 2026
ac4625b
Bump maven-shade-plugin from 3.6.0 to 3.6.2
labianchin May 4, 2026
9f5ff69
Use Java 21 on deploy
labianchin May 4, 2026
774604e
Test with Java 25
labianchin May 4, 2026
e1616da
Java 21 for e2e tests
labianchin May 4, 2026
e2858f1
Support Java 25 build
labianchin May 4, 2026
0734694
Drop Java 11 support, raise floor to JDK 17
labianchin May 5, 2026
53025b8
Add dbeam-parquet module for JDBC to Parquet export
labianchin Apr 2, 2026
3aaad51
Add comprehensive tests for dbeam-parquet module
labianchin Apr 2, 2026
2fb1cdd
Add BenchJdbcParquetJob and Parquet support in e2e tests
labianchin Apr 2, 2026
2af6b6b
Use runParquetSuite
labianchin Apr 2, 2026
02b988d
Fix avroCodec to Parquet codec mapping in JdbcParquetJob
labianchin Apr 2, 2026
3636d6a
Add BeamJdbcParquetSchema for schema metrics and input file support
labianchin Apr 2, 2026
61b8ce1
Add --parquetSchemaFilePath option for input schema override
labianchin Apr 2, 2026
220251a
Add PsqlParquetJob for PostgreSQL exports with replication check
labianchin Apr 2, 2026
51a07a6
Include dbeam-parquet coverage in Codecov upload
labianchin Apr 2, 2026
534c964
Add Parquet type conversion documentation
labianchin Apr 2, 2026
80d400d
Add tests for PsqlParquetJob and BeamJdbcParquetSchema
labianchin Apr 2, 2026
afd4d1f
Consolidate shade plugin config using dbeam.mainClass property
labianchin Apr 2, 2026
249da71
Upgrade e2e PostgreSQL image from 16 to 18
labianchin Apr 2, 2026
a38e88d
Add test for BenchJdbcParquetJob TSV metrics output
labianchin Apr 2, 2026
d40083b
Add PostgreSQL-specific mock tests for Parquet encoding
labianchin Apr 2, 2026
7e0b6a6
Add --parquetCodec option for direct Parquet codec selection
labianchin Apr 2, 2026
4a1f724
Track actual bytes written in Parquet export metrics
labianchin Apr 2, 2026
766dafa
Update README to document dbeam-parquet module
labianchin Apr 2, 2026
da70e82
Expose --rowGroupSize and --pageSize as CLI options
labianchin Apr 2, 2026
e9a11bf
Remove unused testDir field from BenchJdbcParquetJobTest
labianchin Apr 2, 2026
f2a20b3
Add parquet-tools validation to e2e tests
labianchin Apr 2, 2026
c97fe33
Use Parquet LIST type for SQL ARRAY columns
labianchin Apr 2, 2026
a851dd1
Add tests for null array elements in Parquet LIST encoding
labianchin Apr 7, 2026
b19efb1
Support typed array elements in Parquet LIST columns
labianchin Apr 7, 2026
8032ab5
Write Avro schema in Parquet file footer metadata
labianchin Apr 7, 2026
4f8a2db
Remove unused ParquetMetadata import from JdbcParquetRecordTest
labianchin Apr 7, 2026
4752a83
Assert parquet.avro.schema presence in e2e tests
labianchin Apr 7, 2026
12d5859
Add CHANGELOG documenting dbeam-parquet module
labianchin Apr 7, 2026
b413e95
Wire --arrayMode option into Parquet export
labianchin Apr 7, 2026
4897b01
Extract unified JdbcMetering from JdbcAvroMetering and JdbcParquetMet…
labianchin Apr 9, 2026
a6c86f1
Extract unified BenchJdbcJob from BenchJdbcAvroJob and BenchJdbcParqu…
labianchin Apr 9, 2026
a2a372e
Fix UUID write to match FIXED_LEN_BYTE_ARRAY(16) schema
labianchin Apr 15, 2026
f847d9f
Make Calendar thread-safe in JdbcParquetWriteSupport
labianchin Apr 15, 2026
8c17ba5
Close InputStream in BeamJdbcParquetSchema.parseInputParquetSchemaFile
labianchin Apr 15, 2026
d3ed598
Fix NPE in BenchJdbcJob when metric key is missing from map
labianchin Apr 15, 2026
feb4704
Align default rowGroupSize to 128MB in JdbcParquetArgs
labianchin Apr 15, 2026
3ffd233
Query database once for both Parquet and Avro schemas
labianchin Apr 15, 2026
f9d393d
Rename normalizeForAvro to normalizeFieldName in JdbcParquetSchema
labianchin Apr 15, 2026
6f70f95
Make LOGGER fields final in JdbcParquetJob and BeamJdbcParquetSchema
labianchin Apr 15, 2026
a2f2582
Document DECIMAL/NUMERIC type conversion in Parquet docs
labianchin Apr 15, 2026
dff137d
Use portable file size command in e2e.sh
labianchin Apr 15, 2026
1d642bc
Change rowGroupSize and pageSize from int to long
labianchin Apr 17, 2026
616db9f
Share normalizeFieldName between JdbcParquetSchema and WriteSupport
labianchin Apr 17, 2026
e8da56f
Add null guard in mapAvroCodecToParquetCodec
labianchin Apr 17, 2026
37fc3fe
Expose schema metrics on file-override path
labianchin Apr 17, 2026
3c25ebe
Add comments noting DATE is stored as TIMESTAMP(MILLIS)
labianchin Apr 17, 2026
81b5677
Remove unused BeamJdbcParquetSchema.createSchema
labianchin Apr 17, 2026
6791a13
Read Parquet schema file via CharStreams with explicit UTF-8
labianchin Apr 17, 2026
5dad9ac
fmt
labianchin Apr 17, 2026
c592db8
Migrate parent POM from JUnit 4 to JUnit 5
labianchin May 13, 2026
05cef42
Migrate dbeam-core tests from JUnit 4 to JUnit 5
labianchin May 13, 2026
6276a05
Migrate dbeam-parquet tests from JUnit 4 to JUnit 5
labianchin May 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: ['11', '17', '21']
java_version: ['17', '21', '25']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -44,27 +44,31 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./dbeam-core/target/site/jacoco/jacoco.xml
files: ./dbeam-core/target/site/jacoco/jacoco.xml,./dbeam-parquet/target/site/jacoco/jacoco.xml
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
- name: Install avro tools
if: matrix.java_version == '17'
- name: Install avro and parquet tools
if: matrix.java_version == '21'
run: |
wget https://dlcdn.apache.org/avro/avro-1.11.3/java/avro-tools-1.11.3.jar
wget https://dlcdn.apache.org/avro/avro-1.11.5/java/avro-tools-1.11.5.jar
mkdir -p /opt/avro
mv avro-tools-1.11.3.jar /opt/avro/
chmod +x /opt/avro/avro-tools-1.11.3.jar
echo "alias avro-tools='java -jar /opt/avro/avro-tools-1.11.3.jar'" > ~/.bashrc
mv avro-tools-1.11.5.jar /opt/avro/
chmod +x /opt/avro/avro-tools-1.11.5.jar
echo "alias avro-tools='java -jar /opt/avro/avro-tools-1.11.5.jar'" > ~/.bashrc
wget -q https://repo1.maven.org/maven2/org/apache/parquet/parquet-cli/1.14.4/parquet-cli-1.14.4-runtime.jar
mkdir -p /opt/parquet
mv parquet-cli-1.14.4-runtime.jar /opt/parquet/
echo "alias parquet-tools='java -jar /opt/parquet/parquet-cli-1.14.4-runtime.jar'" >> ~/.bashrc
- name: End to end tests
shell: bash
if: matrix.java_version == '17'
if: matrix.java_version == '21'
run: ./e2e/e2e.sh
- run: mkdir staging && cp /tmp/debeam_e2e.log ./staging
if: matrix.java_version == '17'
if: matrix.java_version == '21'
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && matrix.java_version == '17'
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && matrix.java_version == '21'
with:
name: Package
path: staging
Expand All @@ -86,12 +90,12 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2
key: Linux-java11-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: Linux-java11-m2
- name: Set up JDK 11
key: Linux-java21-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: Linux-java21-m2
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '21'
distribution: 'adopt' # use Corretto once supported https://github.com/actions/setup-java/issues/68
- name: Deploy
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.m2
key: Linux-java11-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: Linux-java11-m2
- name: Set up JDK 11
key: Linux-java17-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: Linux-java17-m2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
# setup-java generates a settings.xml pointing deployments to Sonatype
# See https://github.com/actions/setup-java/blob/v3.11.0/docs/advanced-usage.md#publishing-using-apache-maven
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

## [Unreleased]

### Added

- **dbeam-parquet module**: New module for exporting SQL databases directly to Parquet files,
complementing the existing Avro export in dbeam-core.
- `JdbcParquetJob`: Main entry point for Parquet exports, reuses all shared infrastructure
from dbeam-core (JDBC connectors, query building, partitioning, parallel queries, Beam runners).
- `JdbcParquetSchema`: Converts JDBC ResultSetMetaData to Parquet MessageType schema with
full SQL type mapping including logical types (TIMESTAMP_MILLIS, UUID).
- `JdbcParquetWriteSupport`: Writes ResultSet rows directly to Parquet RecordConsumer
without intermediate objects.
- `ChannelOutputFile`: OutputFile implementation backed by WritableByteChannel, bypassing
Hadoop for file I/O.
- Parquet compression codecs: snappy, gzip, zstd, lz4, uncompressed via `--parquetCodec`
option (also auto-maps from `--avroCodec`).
- SQL ARRAY columns use Parquet 3-level LIST type with typed elements (INT32, INT64, FLOAT,
DOUBLE, BOOLEAN, STRING) inferred from column type name.
- Parquet file footer includes `parquet.avro.schema` key with the Avro schema JSON, generated
via JdbcAvroSchema for full compatibility with Spark, Hive, and BigQuery.
- `_AVRO_SCHEMA.avsc` file saved alongside `_PARQUET_SCHEMA.json` in output directory.
- `--parquetSchemaFilePath`: Input schema override (Parquet MessageType text format).
- `--rowGroupSize` (default 128MB) and `--pageSize` (default 1MB) options.
- `BeamJdbcParquetSchema`: Exposes schema creation timing as Beam metric.
- `PsqlParquetJob`: PostgreSQL-specific job with replication lag check.
- `BenchJdbcParquetJob`: Benchmarking job for multi-execution performance testing.
- End-to-end test support in `e2e/e2e.sh` with `parquet-tools` validation.
- Comprehensive test suite (90+ tests) covering schema conversion, record roundtrips,
typed arrays, null handling, mock-based PostgreSQL type tests, and footer metadata.

### Changed

- Parent POM: Shade plugin config parameterized via `${dbeam.mainClass}` property,
eliminating duplication between dbeam-core and dbeam-parquet.
- `PsqlReplicationCheck.validateOptions()` made public for cross-module access.
- dbeam-core: Added test-jar packaging for test helper sharing.
- CI: Codecov upload includes dbeam-parquet coverage. Parquet-tools installed for e2e validation.
- e2e: PostgreSQL upgraded from 16 to 18. Parquet test suite runs alongside Avro suite.
- Documentation: README updated with Parquet usage examples, library dependencies, and feature list.
New `docs/parquet-type-conversion.md` with full type mapping table.
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,38 @@ This tool is runnable locally, or on any other backend supported by Apache Beam,
## Overview

DBeam is a tool that reads all the data from single SQL database table,
converts the data into [Avro](https://avro.apache.org/) and stores it into
converts the data into [Avro](https://avro.apache.org/) or [Parquet](https://parquet.apache.org/) and stores it into
appointed location, usually in GCS.
It runs as a single threaded [Apache Beam](https://beam.apache.org/) pipeline.

DBeam requires the database credentials, the database table name to read, and the output location
to store the extracted data into. DBeam first makes a single select into the target table with
limit one to infer the table schema. After the schema is created the job will be launched which
simply streams the table contents via JDBC into target location as Avro.
simply streams the table contents via JDBC into target location as Avro or Parquet.

[Generated Avro Schema Type Conversion Details](docs/type-conversion.md)
Type conversion details: [Avro](docs/type-conversion.md) | [Parquet](docs/parquet-type-conversion.md)


## dbeam-core package features

- Supports both PostgreSQL, MySQL, MariaDB, and H2 JDBC connectors
- Supports [Google CloudSQL](https://cloud.google.com/sql/) managed databases
- Currently outputs only to Avro format
- Outputs to Avro format
- Reads database from an external password file (`--passwordFile`) or an external [KMS](https://cloud.google.com/kms/) encrypted password file (`--passwordFileKmsEncrypted`)
- Can filter only records of the current day with the `--partitionColumn` parameter
- Check and fail on too old partition dates. Snapshot dumps are not filtered by a given date/partition, when running for a too old partition, the job fails to avoid new data in old partitions. (can be disabled with `--skipPartitionCheck`)
- Implemented as [Apache Beam SDK](https://beam.apache.org/) pipeline, supporting any of its [runners](https://beam.apache.org/documentation/runners/capability-matrix/) (tested with `DirectRunner` and `DataflowRunner`)

## dbeam-parquet package features

- Outputs to Parquet format (columnar, optimized for analytical queries)
- Reuses all dbeam-core infrastructure (JDBC connectors, CloudSQL, partitioning, parallel queries)
- Supports Parquet compression codecs: snappy, gzip, zstd, lz4, uncompressed
- No full Hadoop dependency — uses a minimal `hadoop-common` for the Parquet API surface
- Separate `--parquetCodec` option or automatic mapping from `--avroCodec`
- Optional input schema file via `--parquetSchemaFilePath` (Parquet MessageType text format)
- PostgreSQL replication check via `PsqlParquetJob`

### DBeam export parameters

```
Expand Down Expand Up @@ -171,15 +181,19 @@ Building and testing can be achieved with `mvn`:
mvn verify
```

In order to create a jar with all dependencies under `./dbeam-core/target/dbeam-core-shaded.jar` run the following:
In order to create jars with all dependencies run the following:

```sh
mvn clean package -Ppack
```

This produces:
- `./dbeam-core/target/dbeam-core-shaded.jar` — Avro export
- `./dbeam-parquet/target/dbeam-parquet-shaded.jar` — Parquet export

## Usage examples

Using Java from the command line:
### Avro export

```sh
java -cp ./dbeam-core/target/dbeam-core-shaded.jar \
Expand All @@ -191,7 +205,20 @@ java -cp ./dbeam-core/target/dbeam-core-shaded.jar \
--table=my_table
```

For CloudSQL:
### Parquet export

```sh
java -cp ./dbeam-parquet/target/dbeam-parquet-shaded.jar \
com.spotify.dbeam.parquet.JdbcParquetJob \
--output=gs://my-testing-bucket-name/ \
--username=my_database_username \
--password=secret \
--connectionUrl=jdbc:postgresql://some.database.uri.example.org:5432/my_database \
--table=my_table \
--parquetCodec=snappy
```

For CloudSQL (Avro):

```sh
java -cp ./dbeam-core/target/dbeam-core-shaded.jar \
Expand Down Expand Up @@ -256,19 +283,28 @@ When using Google Cloud, [IAM authentication](https://github.com/GoogleCloudPlat
To include DBeam library in a mvn project add the following dependency in `pom.xml`:

```xml
<!-- For Avro export -->
<dependency>
<groupId>com.spotify</groupId>
<artifactId>dbeam-core</artifactId>
<version>${dbeam.version}</version>
</dependency>

<!-- For Parquet export -->
<dependency>
<groupId>com.spotify</groupId>
<artifactId>dbeam-parquet</artifactId>
<version>${dbeam.version}</version>
</dependency>
```


To include DBeam library in a SBT project add the following dependency in `build.sbt`:

```sbt
libraryDependencies ++= Seq(
"com.spotify" % "dbeam-core" % dbeamVersion
"com.spotify" % "dbeam-core" % dbeamVersion, // Avro
"com.spotify" % "dbeam-parquet" % dbeamVersion // Parquet
)
```

Expand Down
7 changes: 6 additions & 1 deletion dbeam-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<artifactId>dbeam-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.spotify</groupId>
<artifactId>dbeam-parquet</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -47,7 +52,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>attach-effective-pom</id>
Expand Down
24 changes: 22 additions & 2 deletions dbeam-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<name>DBeam Core</name>
<description>Top level DBeam core implementation</description>

<properties>
<dbeam.mainClass>com.spotify.dbeam.jobs.JdbcAvroJob</dbeam.mainClass>
</properties>

<dependencies>
<!-- SDK -->
<dependency>
Expand Down Expand Up @@ -93,8 +97,8 @@
<!-- Test Deps -->

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -124,4 +128,20 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public static JdbcAvroArgs create(
}

public static JdbcAvroArgs create(final JdbcConnectionArgs jdbcConnectionArgs) {
return create(jdbcConnectionArgs, 10000, "deflate6", Collections.emptyList(),
"typed_first_row", false);
return create(
jdbcConnectionArgs, 10000, "deflate6", Collections.emptyList(), "typed_first_row", false);
}

public interface StatementPreparator extends Serializable {
Expand Down
13 changes: 6 additions & 7 deletions dbeam-core/src/main/java/com/spotify/dbeam/avro/JdbcAvroIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.io.CountingOutputStream;
import com.spotify.dbeam.args.JdbcAvroArgs;
import com.spotify.dbeam.args.JdbcExportArgs;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.sql.Connection;
Expand Down Expand Up @@ -137,7 +136,7 @@ private static class JdbcAvroWriter extends FileBasedSink.Writer<Void, String> {
private final JdbcAvroArgs jdbcAvroArgs;
private DataFileWriter<GenericRecord> dataFileWriter;
private Connection connection;
private JdbcAvroMetering metering;
private JdbcMetering metering;
private CountingOutputStream countingOutputStream;

JdbcAvroWriter(
Expand All @@ -147,7 +146,7 @@ private static class JdbcAvroWriter extends FileBasedSink.Writer<Void, String> {
super(writeOperation, MimeTypes.BINARY);
this.dynamicDestinations = dynamicDestinations;
this.jdbcAvroArgs = jdbcAvroArgs;
this.metering = JdbcAvroMetering.create();
this.metering = JdbcMetering.create("jdbcavroio");
}

public Void getDestination() {
Expand Down Expand Up @@ -181,8 +180,7 @@ private ResultSet executeQuery(final String query) throws Exception {
jdbcAvroArgs.statementPreparator().setParameters(statement);
}

if (jdbcAvroArgs.preCommand() != null
&& !jdbcAvroArgs.preCommand().isEmpty()) {
if (jdbcAvroArgs.preCommand() != null && !jdbcAvroArgs.preCommand().isEmpty()) {
final Statement stmt = connection.createStatement();
for (String command : jdbcAvroArgs.preCommand()) {
stmt.execute(command);
Expand All @@ -205,8 +203,9 @@ public void write(final String query) throws Exception {
LOGGER.info("jdbcavroio : Starting write...");
try (ResultSet resultSet = executeQuery(query)) {
metering.startWriteMeter();
final JdbcAvroRecordConverter converter = JdbcAvroRecordConverter.create(resultSet,
this.jdbcAvroArgs.arrayMode(), this.jdbcAvroArgs.nullableArrayItems());
final JdbcAvroRecordConverter converter =
JdbcAvroRecordConverter.create(
resultSet, this.jdbcAvroArgs.arrayMode(), this.jdbcAvroArgs.nullableArrayItems());
while (resultSet.next()) {
dataFileWriter.appendEncoded(converter.convertResultSetIntoAvroBytes());
this.metering.incrementRecordCount();
Expand Down
Loading
Loading