Skip to content

Commit

Permalink
add clickhouse batch.Limit
Browse files Browse the repository at this point in the history
  • Loading branch information
flarco committed May 31, 2024
1 parent deaf46d commit cc6d22b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/dbio/database/database_clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ func (conn *ClickhouseConn) NewTransaction(ctx context.Context, options ...*sql.
Tx := &BaseTransaction{Tx: tx, Conn: conn.Self(), context: &context}
conn.tx = Tx

// CH does not support transactions at the moment
// Tx := &BlankTransaction{Conn: conn.Self(), context: &context}

return Tx, nil
}

Expand Down Expand Up @@ -134,6 +131,7 @@ func (conn *ClickhouseConn) BulkImportStream(tableFName string, ds *iop.Datastre
}

for batch := range ds.BatchChan {
batch.Limit = 20000
if batch.ColumnsChanged() || batch.IsFirst() {
columns, err = conn.GetColumns(tableFName, batch.Columns.Names()...)
if err != nil {
Expand Down

0 comments on commit cc6d22b

Please sign in to comment.