Skip to content

Commit 5997f8c

Browse files
committed
cdk-fix-zerobyte-flush
1 parent 7057fc3 commit 5997f8c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

airbyte-cdk/java/airbyte-cdk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ corresponds to that version.
174174

175175
| Version | Date | Pull Request | Subject |
176176
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
177+
| 0.36.6 | 2024-06-05 | [\#39106](https://github.com/airbytehq/airbyte/pull/39106) | Skip write to storage with 0 byte file |
177178
| 0.36.5 | 2024-06-01 | [\#38792](https://github.com/airbytehq/airbyte/pull/38792) | Throw config exception if no selectable table exists in user provided schemas |
178179
| 0.36.4 | 2024-05-31 | [\#38824](https://github.com/airbytehq/airbyte/pull/38824) | Param marked as non-null to nullable in JdbcDestinationHandler for NPE fix |
179180
| 0.36.2 | 2024-05-29 | [\#38538](https://github.com/airbytehq/airbyte/pull/38357) | Exit connector when encountering a config error. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.36.5
1+
version=0.36.6

airbyte-cdk/java/airbyte-cdk/s3-destinations/src/main/kotlin/io/airbyte/cdk/integrations/destination/staging/operation/StagingStreamOperations.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class StagingStreamOperations<DestinationState : MinimumDestinationState>(
5050
log.info {
5151
"Buffer flush complete for stream ${streamConfig.id.originalName} (${FileUtils.byteCountToDisplaySize(it.byteCount)}) to staging"
5252
}
53-
storageOperation.writeToStage(streamConfig, writeBuffer)
53+
if (it.byteCount != 0L) {
54+
storageOperation.writeToStage(streamConfig, writeBuffer)
55+
} else {
56+
log.info { "Skipping writing to storage since there are no bytes to write" }
57+
}
5458
}
5559
}
5660
}

0 commit comments

Comments
 (0)