Skip to content

Commit

Permalink
customize the batch size for proton
Browse files Browse the repository at this point in the history
  • Loading branch information
jovezhong committed Jul 17, 2024
1 parent adaed27 commit 5cbce10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/dbio/database/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ func InsertBatchStream(conn Connection, tx Transaction, tableFName string, ds *i
row = processClickhouseInsertRow(bColumns, row)
} else if conn.GetType() == dbio.TypeDbTrino {
row = processTrinoInsertRow(bColumns, row)
} else if conn.GetType() == dbio.TypeDbProton {
row = processClickhouseInsertRow(bColumns, row)
}
vals = append(vals, row...)
}
Expand Down Expand Up @@ -391,6 +393,12 @@ func InsertBatchStream(conn Connection, tx Transaction, tableFName string, ds *i
batchSize = cast.ToInt(conn.GetTemplateValue("variable.batch_values")) / len(columns)
}

if conn.GetType() == dbio.TypeDbProton {
batchSize = 100
} else {
batchSize = cast.ToInt(conn.GetTemplateValue("variable.batch_values")) / len(columns)
}

for row := range batch.Rows {
batchRows = append(batchRows, row)
count++
Expand Down

0 comments on commit 5cbce10

Please sign in to comment.