Skip to content

Commit

Permalink
add: max_partitions_per_insert_block clickhouse sink (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyxo authored Feb 3, 2025
1 parent f52525c commit eb5f78d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions gen/source/sink/Clickhouse.pkl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkl/PklProject
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ amends "pkl:Project"

package {
name = "pipelaner"
version = "1.0.5"
version = "1.0.6"
baseUri = "package://github.com/pipelane/pipelaner"
sourceCode = "https://github.com/pipelane/pipelaner"
packageZipUrl = "https://github.com/pipelane/pipelaner/releases/download/\(name)@\(version)/\(name)@\(version).zip"
Expand Down
8 changes: 1 addition & 7 deletions pkl/source/sink/Sinks.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Clickhouse extends Sink {

asyncInsert: String = "1"
waitForAsyncInsert: String = "1"
maxPartitionsPerInsertBlock: Int = 1000
}

typealias Method = "PATCH"|"POST"|"PUT"|"DELETE"|"GET"
Expand All @@ -48,11 +49,4 @@ class Http extends Sink {
url: String(!isEmpty)
method: Method
headers: Mapping<String, String>?
}


hh = new Mapping {
["Authorization"] {
"Bearer \(read("env:"))"
}
}
4 changes: 4 additions & 0 deletions sources/sink/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func (c *Clickhouse) write(ctx context.Context, chData chan any) error {
Value: c.clickConfig.GetWaitForAsyncInsert(),
Important: true,
},
{
Key: "max_partitions_per_insert_block",
Value: fmt.Sprintf("%d", c.clickConfig.GetMaxPartitionsPerInsertBlock()),
},
},
OnInput: func(_ context.Context) error {
input.Reset()
Expand Down

0 comments on commit eb5f78d

Please sign in to comment.