This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Commit 0b1a835
authored
Adding experimental (and limited) support for table partitioning (#1347)
We're adding a `partitioningStrategy` to index configuration:
```yaml
processors:
- name: my-query-processor
type: quesma-v1-processor-query
config:
indexes:
'*':
partitioningStrategy: "daily"
target: [ my-clickhouse-data-source ]
try_it:
partitioningStrategy: "monthly"
target: [ my-clickhouse-data-source ]
```
Having `partitioningStrategy` essentially adds `PARTITION BY function(`
to `CREATE TABLE` statement executed by Quesma.
Key points:
1) `partitioningStrategy` is applied only on table creation handled by
Quesma. **If the table already exists, Quesma won't modify it.**
2) `partitioningStrategy` can be set to `hourly`, `daily`, `monthly` and
`yearly`.
3) **We're not adding common table partitioning support** - so if index
has `useCommonTable: true` specified together with any
`partitioningStrategy` - Quesma is going to fail due to invalid
configuration
4) Leaving `partitioningStrategy` not specified means table is not
partitioned at all (== ClickHouse default)
<!-- A note on testing your PR -->
<!-- Basic unit test run is executed against each commit in the PR.
If you want to run a full integration test suite, you can trigger it by
commenting
with '/run-integration-tests' -->1 parent 40897bb commit 0b1a835
File tree
11 files changed
+157
-34
lines changed- platform
- clickhouse
- config
- test_configs
- ingest
11 files changed
+157
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | 363 | | |
365 | 364 | | |
366 | 365 | | |
| |||
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | | - | |
385 | 383 | | |
386 | 384 | | |
387 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
| |||
438 | 437 | | |
439 | 438 | | |
440 | 439 | | |
441 | | - | |
442 | 440 | | |
443 | 441 | | |
444 | 442 | | |
| |||
519 | 517 | | |
520 | 518 | | |
521 | 519 | | |
522 | | - | |
523 | 520 | | |
524 | 521 | | |
525 | 522 | | |
| |||
606 | 603 | | |
607 | 604 | | |
608 | 605 | | |
609 | | - | |
610 | 606 | | |
611 | 607 | | |
612 | 608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
345 | | - | |
346 | | - | |
| 347 | + | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
361 | 381 | | |
362 | 382 | | |
363 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
344 | 357 | | |
345 | 358 | | |
346 | 359 | | |
| |||
842 | 855 | | |
843 | 856 | | |
844 | 857 | | |
| 858 | + | |
845 | 859 | | |
846 | 860 | | |
847 | 861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
23 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
645 | 650 | | |
646 | 651 | | |
647 | 652 | | |
| |||
1011 | 1016 | | |
1012 | 1017 | | |
1013 | 1018 | | |
1014 | | - | |
1015 | 1019 | | |
1016 | 1020 | | |
1017 | 1021 | | |
| |||
1028 | 1032 | | |
1029 | 1033 | | |
1030 | 1034 | | |
1031 | | - | |
1032 | 1035 | | |
1033 | 1036 | | |
1034 | 1037 | | |
| |||
0 commit comments