You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add customizable PARTITION BY support for ClickHouse tables (#164)
* Add partition_bys config option similar to indexes with database/table filtering
* Support custom PARTITION BY expressions to override default intDiv(id, 4294967)
* Useful for time-based partitioning like toYYYYMM(created_at) for Snowflake IDs
* Maintains backward compatibility with existing default behavior
* Add test verification for custom partition_by functionality
Fixes#161
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,6 +230,11 @@ indexes: # optional
230
230
tables: ['test_table']
231
231
index: 'INDEX name_idx name TYPE ngrambf_v1(5, 65536, 4, 0) GRANULARITY 1'
232
232
233
+
partition_bys: # optional
234
+
- databases: '*'
235
+
tables: ['test_table']
236
+
partition_by: 'toYYYYMM(created_at)'
237
+
233
238
http_host: '0.0.0.0'# optional
234
239
http_port: 9128# optional
235
240
@@ -258,6 +263,7 @@ ignore_deletes: false # optional, set to true to ignore DELETE operations
258
263
- `auto_restart_interval`- interval (seconds) between automatic db_replicator restart. Default 3600 (1 hour). This is done to reduce memory usage.
259
264
- `binlog_retention_period`- how long to keep binlog files in seconds. Default 43200 (12 hours). This setting controls how long the local binlog files are retained before being automatically cleaned up.
260
265
- `indexes`- you may want to add some indexes to accelerate performance, eg. ngram index for full-test search, etc. To apply indexes you need to start replication from scratch.
266
+
- `partition_bys`- custom PARTITION BY expressions for tables. By default uses `intDiv(id, 4294967)` for integer primary keys. Useful for time-based partitioning like `toYYYYMM(created_at)`.
261
267
- `http_host`, `http_port` - http endpoint to control replication, use `/docs` for abailable commands
262
268
- `types_mappings`- custom types mapping, eg. you can map char(36) to UUID instead of String, etc.
263
269
- `ignore_deletes`- when set to `true`, DELETE operations in MySQL will be ignored during replication. This creates an append-only model where data is only added, never removed. In this mode, the replicator doesn't create a temporary database and instead replicates directly to the target database.
0 commit comments