Skip to content

Commit

Permalink
chore: reflect prod schema in local plugin_log_entries (#18732)
Browse files Browse the repository at this point in the history
* chore: just bump the max insert partitions for dev

* remove setting that is not yet available

* ruff

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
fuziontech and github-actions[bot] authored Nov 17, 2023
1 parent 4164eee commit 6511bec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions docker/clickhouse/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,6 @@
</merge_tree>
-->

<throw_on_max_partitions_per_insert_block>0</throw_on_max_partitions_per_insert_block>

<!-- Protection from accidental DROP.
If size of a MergeTree table is greater than max_table_size_to_drop (in bytes) than table could not
be dropped with any DROP query.
Expand Down
2 changes: 1 addition & 1 deletion posthog/clickhouse/plugin_log_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
PLUGIN_LOG_ENTRIES_TABLE_ENGINE = lambda: ReplacingMergeTree(PLUGIN_LOG_ENTRIES_TABLE, ver="_timestamp")
PLUGIN_LOG_ENTRIES_TABLE_SQL = lambda: (
PLUGIN_LOG_ENTRIES_TABLE_BASE_SQL
+ """PARTITION BY plugin_id ORDER BY (team_id, id)
+ """PARTITION BY toYYYYMMDD(timestamp) ORDER BY (team_id, plugin_id, plugin_config_id, timestamp)
{ttl_period}
SETTINGS index_granularity=512
"""
Expand Down
4 changes: 2 additions & 2 deletions posthog/clickhouse/test/__snapshots__/test_schema.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@
, _offset UInt64

) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/77f1df52-4b43-11e9-910f-b8ca3a9b9f3e_noshard/posthog.plugin_log_entries', '{replica}-{shard}', _timestamp)
PARTITION BY plugin_id ORDER BY (team_id, id)
PARTITION BY toYYYYMMDD(timestamp) ORDER BY (team_id, plugin_id, plugin_config_id, timestamp)

SETTINGS index_granularity=512

Expand Down Expand Up @@ -2166,7 +2166,7 @@
, _offset UInt64

) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/77f1df52-4b43-11e9-910f-b8ca3a9b9f3e_noshard/posthog.plugin_log_entries', '{replica}-{shard}', _timestamp)
PARTITION BY plugin_id ORDER BY (team_id, id)
PARTITION BY toYYYYMMDD(timestamp) ORDER BY (team_id, plugin_id, plugin_config_id, timestamp)

SETTINGS index_granularity=512

Expand Down

0 comments on commit 6511bec

Please sign in to comment.