feat(eap-items): drop attributes_array JSON column from distributed tables - #8236
Open
onewland wants to merge 2 commits into
Open
feat(eap-items): drop attributes_array JSON column from distributed tables#8236onewland wants to merge 2 commits into
onewland wants to merge 2 commits into
Conversation
|
This PR has a migration; here is the generated SQL for -- start migrations
-- forward migration events_analytics_platform : 0062_drop_attributes_array_json_from_dist
Distributed op: ALTER TABLE eap_items_1_dist ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_8_dist ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_64_dist ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_512_dist ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_dist_ro ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_8_dist_ro ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_64_dist_ro ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
Distributed op: ALTER TABLE eap_items_1_downsample_512_dist_ro ON CLUSTER 'cluster_one_sh' DROP COLUMN IF EXISTS attributes_array;
-- end forward migration events_analytics_platform : 0062_drop_attributes_array_json_from_dist
-- backward migration events_analytics_platform : 0062_drop_attributes_array_json_from_dist
Distributed op: ALTER TABLE eap_items_1_downsample_512_dist_ro ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_downsample_64_dist_ro ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_downsample_8_dist_ro ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_dist_ro ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_downsample_512_dist ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_downsample_64_dist ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_downsample_8_dist ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Distributed op: ALTER TABLE eap_items_1_dist ON CLUSTER 'cluster_one_sh' ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;
-- end backward migration events_analytics_platform : 0062_drop_attributes_array_json_from_dist |
onewland
marked this pull request as ready for review
July 29, 2026 15:40
phacops
requested changes
Jul 29, 2026
Comment on lines
+60
to
+69
| return [ | ||
| operations.AddColumn( | ||
| storage_set=ss, | ||
| table_name=table, | ||
| column=attributes_array_column, | ||
| after=after, | ||
| target=OperationTarget.DISTRIBUTED, | ||
| ) | ||
| for (ss, table) in reversed(_tables()) | ||
| ] |
Contributor
There was a problem hiding this comment.
Let's not add the column back in case we need to go backwards.
phacops
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reprise of #8231, which was reverted (451f9eb): dropping
attributes_arrayfrom the downsample local MergeTree tables triggered a full part rewrite even though the column was empty, which is unacceptable in customer-facing environments.This version (migration
0062_drop_attributes_array_json_from_dist) drops theattributes_arrayJSON column (added in 0050, superseded by the typedattributes_array_{string,int,float,bool}map columns from 0059) from distributed tables only — a metadata-only change with no data rewrites:eap_items_1_dist+ downsample_disttables (EVENTS_ANALYTICS_PLATFORM)eap_items_1_dist_ro+ downsample_dist_rotables (EVENTS_ANALYTICS_PLATFORM_RO, inherited viaCREATE TABLE ... ASin 0056)Notes:
attributes_array(verified across all MV versions mv_1–mv_9), so the column holds only default values there and nothing references it.eap_items_1_localage out around mid-October 2026, after which the local-table column could be revisited.