Skip to content

Commit

Permalink
sync-sidecar: force temporaryBatchSize=100000 for sftp and file sources
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Sep 19, 2024
1 parent 758d6bd commit 66aaf69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sync-sidecar/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ import (
const interruptError = "Stream was interrupted. Check logs for errors."
const cancelledError = "Sync job was cancelled"

var forceTemporaryBatchesSources = types2.NewSet(
"airbyte/source-sftp-bulk",
"airbyte/source-file",
"airbyte/source-sftp",
)

type ReadSideCar struct {
*AbstractSideCar
namespace string
Expand Down Expand Up @@ -438,7 +444,7 @@ func (s *ReadSideCar) openStream(streamName string) (*ActiveStream, error) {
} else if len(str.DefaultCursorField) > 0 {
streamOptions = append(streamOptions, bulker.WithDiscriminatorField(str.DefaultCursorField))
}
if str.SyncMode != "incremental" {
if str.SyncMode != "incremental" || forceTemporaryBatchesSources.Contains(s.packageName) {
streamOptions = append(streamOptions, sql.WithTemporaryBatchSize(100000))
}
if namespace != "" {
Expand Down

0 comments on commit 66aaf69

Please sign in to comment.