-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bnchrch/remove-approve-and-merge
- Loading branch information
Showing
79 changed files
with
815 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-cdk/java/airbyte-cdk/core/src/main/resources/version.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=0.5.3 | ||
version=0.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...s/src/main/java/io/airbyte/cdk/integrations/destination/jdbc/JdbcInsertFlushFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.integrations.destination.jdbc; | ||
|
||
import io.airbyte.cdk.integrations.destination.buffered_stream_consumer.RecordWriter; | ||
import io.airbyte.cdk.integrations.destination.jdbc.constants.GlobalDataSizeConstants; | ||
import io.airbyte.cdk.integrations.destination_async.DestinationFlushFunction; | ||
import io.airbyte.cdk.integrations.destination_async.partial_messages.PartialAirbyteMessage; | ||
import io.airbyte.protocol.models.v0.AirbyteStreamNameNamespacePair; | ||
import io.airbyte.protocol.models.v0.StreamDescriptor; | ||
import java.util.stream.Stream; | ||
|
||
public class JdbcInsertFlushFunction implements DestinationFlushFunction { | ||
|
||
private final RecordWriter<PartialAirbyteMessage> recordWriter; | ||
|
||
public JdbcInsertFlushFunction(final RecordWriter<PartialAirbyteMessage> recordWriter) { | ||
this.recordWriter = recordWriter; | ||
} | ||
|
||
@Override | ||
public void flush(final StreamDescriptor desc, final Stream<PartialAirbyteMessage> stream) throws Exception { | ||
recordWriter.accept( | ||
new AirbyteStreamNameNamespacePair(desc.getName(), desc.getNamespace()), | ||
stream.toList()); | ||
} | ||
|
||
@Override | ||
public long getOptimalBatchSizeBytes() { | ||
// TODO tune this value - currently SqlOperationUtils partitions 10K records per insert statement, | ||
// but we'd like to stop doing that and instead control sql insert statement size via batch size. | ||
return GlobalDataSizeConstants.DEFAULT_MAX_BATCH_SIZE_BYTES; | ||
} | ||
|
||
} |
Oops, something went wrong.