Skip to content

Commit 600587b

Browse files
[Destination MS SQL V2] Correct Part Size, No buffered input stream (#55252)
1 parent 68a4e62 commit 600587b

File tree

5 files changed

+26
-21
lines changed

5 files changed

+26
-21
lines changed

airbyte-cdk/bulk/toolkits/load-azure-blob-storage/src/main/kotlin/io/airbyte/cdk/load/file/azureBlobStorage/AzureBlobStreamingUpload.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import io.airbyte.cdk.load.command.azureBlobStorage.AzureBlobStorageConfiguratio
99
import io.airbyte.cdk.load.file.object_storage.StreamingUpload
1010
import io.airbyte.cdk.load.util.setOnce
1111
import io.github.oshai.kotlinlogging.KotlinLogging
12-
import java.io.BufferedInputStream
1312
import java.nio.ByteBuffer
1413
import java.util.Base64
1514
import java.util.concurrent.ConcurrentSkipListMap
@@ -42,14 +41,16 @@ class AzureBlobStreamingUpload(
4241

4342
// The stageBlock call can be done asynchronously or blocking.
4443
// Here we use the blocking call in a coroutine context.
45-
BufferedInputStream(part.inputStream()).use {
44+
part.inputStream().use {
4645
blockBlobClient.stageBlock(
4746
blockId,
4847
it,
4948
part.size.toLong(),
5049
)
5150
}
5251

52+
log.info { "Staged block #$index => $rawBlockId (encoded = $blockId)" }
53+
5354
// Keep track of the blocks in the order they arrived (or the index).
5455
blockIds[index] = blockId
5556
}
@@ -77,6 +78,8 @@ class AzureBlobStreamingUpload(
7778
blockBlobClient.setMetadata(filteredMetadata)
7879
}
7980
}
81+
} else {
82+
log.warn { "Complete called multiple times for ${blockBlobClient.blobName}" }
8083
}
8184

8285
return AzureBlob(blockBlobClient.blobName, config)

airbyte-cdk/bulk/toolkits/load-object-storage/src/main/kotlin/io/airbyte/cdk/load/file/object_storage/ObjectStorageFormattingWriter.kt

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class MSSQLCSVFormattingWriter(
117117
private val printer = finalSchema.toCsvPrinterWithHeader(outputStream)
118118
private val mssqlRowValidator = MSSQLCsvRowValidator(validateValuesPreLoad)
119119
override fun accept(record: DestinationRecordAirbyteValue) {
120-
121120
printer.printRecord(
122121
mssqlRowValidator
123122
.validate(record, this.finalSchema)

airbyte-integrations/connectors/destination-mssql-v2/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data:
1616
type: GSM
1717
connectorType: destination
1818
definitionId: 37a928c1-2d5c-431a-a97d-ae236bd1ea0c
19-
dockerImageTag: 0.1.14
19+
dockerImageTag: 0.1.15
2020
dockerRepository: airbyte/destination-mssql-v2
2121
documentationUrl: https://docs.airbyte.com/integrations/destinations/mssql-v2
2222
githubIssueLabel: destination-mssql-v2

airbyte-integrations/connectors/destination-mssql-v2/src/main/kotlin/io/airbyte/integrations/destination/mssql/v2/config/MSSQLConfiguration.kt

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import io.airbyte.cdk.ConfigErrorException
88
import io.airbyte.cdk.command.FeatureFlag
99
import io.airbyte.cdk.load.command.DestinationConfiguration
1010
import io.airbyte.cdk.load.command.DestinationConfigurationFactory
11+
import io.airbyte.cdk.load.command.object_storage.ObjectStorageUploadConfiguration
1112
import io.micronaut.context.annotation.Factory
1213
import jakarta.inject.Singleton
1314

@@ -25,6 +26,7 @@ data class MSSQLConfiguration(
2526
override val numProcessRecordsWorkers = 1
2627
override val numProcessBatchWorkers: Int = 1
2728
override val processEmptyFiles: Boolean = true
29+
override val recordBatchSizeBytes = ObjectStorageUploadConfiguration.DEFAULT_PART_SIZE_BYTES
2830
}
2931

3032
@Singleton

docs/integrations/destinations/mssql-v2.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,23 @@ You’ll need to supply:
9999
<details>
100100
<summary>Expand to review</summary>
101101

102-
| Version | Date | Pull Request | Subject |
103-
|:--------|:-----------|:----------------------------------------------------------|:-------------------------------------------------------|
104-
| 0.1.14 | 2025-03-05 | [54159](https://github.com/airbytehq/airbyte/pull/54159) | RC12: Support For Bulk Insert Using Azure Blob Storage |
105-
| 0.1.13 | 2025-03-04 | [55193](https://github.com/airbytehq/airbyte/pull/55193) | RC11: Increase decimal precision |
106-
| 0.1.12 | 2025-02-24 | [54648](https://github.com/airbytehq/airbyte/pull/54648) | RC10: Fix index column names with hyphens |
107-
| 0.1.11 | 2025-02-21 | [54197](https://github.com/airbytehq/airbyte/pull/54197) | RC9: Fix index column names with invalid characters |
108-
| 0.1.10 | 2025-02-20 | [54186](https://github.com/airbytehq/airbyte/pull/54186) | RC8: Fix String support |
109-
| 0.1.9 | 2025-02-11 | [53364](https://github.com/airbytehq/airbyte/pull/53364) | RC7: Revert deletion change |
110-
| 0.1.8 | 2025-02-11 | [53364](https://github.com/airbytehq/airbyte/pull/53364) | RC6: Break up deletes into loop to reduce locking |
111-
| 0.1.7 | 2025-02-07 | [53236](https://github.com/airbytehq/airbyte/pull/53236) | RC5: Use rowlock hint |
112-
| 0.1.6 | 2025-02-06 | [53192](https://github.com/airbytehq/airbyte/pull/53192) | RC4: Fix config, timehandling, performance tweak |
113-
| 0.1.5 | 2025-02-04 | [53174](https://github.com/airbytehq/airbyte/pull/53174) | RC3: Fix metadata.yaml for publish |
114-
| 0.1.4 | 2025-02-04 | [52704](https://github.com/airbytehq/airbyte/pull/52704) | RC2: Performance improvement |
115-
| 0.1.3 | 2025-01-24 | [52096](https://github.com/airbytehq/airbyte/pull/52096) | Release candidate |
116-
| 0.1.2 | 2025-01-10 | [51508](https://github.com/airbytehq/airbyte/pull/51508) | Use a non-root base image |
117-
| 0.1.1 | 2024-12-18 | [49870](https://github.com/airbytehq/airbyte/pull/49870) | Use a base image: airbyte/java-connector-base:1.0.0 |
118-
| 0.1.0 | 2024-12-16 | [\#49460](https://github.com/airbytehq/airbyte/pull/49460)| Initial commit |
102+
| Version | Date | Pull Request | Subject |
103+
|:--------|:-----------|:-----------------------------------------------------------|:-------------------------------------------------------|
104+
| 0.1.15 | 2025-03-07 | [55252](https://github.com/airbytehq/airbyte/pull/55252) | RC13: Bugfix for OOM on Bulk Load |
105+
| 0.1.14 | 2025-03-05 | [54159](https://github.com/airbytehq/airbyte/pull/54159) | RC12: Support For Bulk Insert Using Azure Blob Storage |
106+
| 0.1.13 | 2025-03-04 | [55193](https://github.com/airbytehq/airbyte/pull/55193) | RC11: Increase decimal precision |
107+
| 0.1.12 | 2025-02-24 | [54648](https://github.com/airbytehq/airbyte/pull/54648) | RC10: Fix index column names with hyphens |
108+
| 0.1.11 | 2025-02-21 | [54197](https://github.com/airbytehq/airbyte/pull/54197) | RC9: Fix index column names with invalid characters |
109+
| 0.1.10 | 2025-02-20 | [54186](https://github.com/airbytehq/airbyte/pull/54186) | RC8: Fix String support |
110+
| 0.1.9 | 2025-02-11 | [53364](https://github.com/airbytehq/airbyte/pull/53364) | RC7: Revert deletion change |
111+
| 0.1.8 | 2025-02-11 | [53364](https://github.com/airbytehq/airbyte/pull/53364) | RC6: Break up deletes into loop to reduce locking |
112+
| 0.1.7 | 2025-02-07 | [53236](https://github.com/airbytehq/airbyte/pull/53236) | RC5: Use rowlock hint |
113+
| 0.1.6 | 2025-02-06 | [53192](https://github.com/airbytehq/airbyte/pull/53192) | RC4: Fix config, timehandling, performance tweak |
114+
| 0.1.5 | 2025-02-04 | [53174](https://github.com/airbytehq/airbyte/pull/53174) | RC3: Fix metadata.yaml for publish |
115+
| 0.1.4 | 2025-02-04 | [52704](https://github.com/airbytehq/airbyte/pull/52704) | RC2: Performance improvement |
116+
| 0.1.3 | 2025-01-24 | [52096](https://github.com/airbytehq/airbyte/pull/52096) | Release candidate |
117+
| 0.1.2 | 2025-01-10 | [51508](https://github.com/airbytehq/airbyte/pull/51508) | Use a non-root base image |
118+
| 0.1.1 | 2024-12-18 | [49870](https://github.com/airbytehq/airbyte/pull/49870) | Use a base image: airbyte/java-connector-base:1.0.0 |
119+
| 0.1.0 | 2024-12-16 | [\#49460](https://github.com/airbytehq/airbyte/pull/49460) | Initial commit |
119120

120121
</details>

0 commit comments

Comments
 (0)