-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(smart_autocomplete): remove smart autocomplete mv (#6867)
* Takes up too much space * full table scan if the attribute doesn't exist
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
snuba/snuba_migrations/events_analytics_platform/0024_remove_smart_autocomplete_values_mv.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from typing import Sequence | ||
|
||
from snuba.clusters.storage_sets import StorageSetKey | ||
from snuba.migrations import migration, operations | ||
from snuba.migrations.operations import OperationTarget, SqlOperation | ||
|
||
|
||
class Migration(migration.ClickhouseNodeMigration): | ||
|
||
blocking = False | ||
storage_set_key = StorageSetKey.EVENTS_ANALYTICS_PLATFORM | ||
|
||
local_table_name = "eap_trace_item_attrs_local" | ||
dist_table_name = "eap_trace_item_attrs_dist" | ||
mv_name = "eap_trace_item_attrs_mv" | ||
|
||
def forwards_ops(self) -> Sequence[SqlOperation]: | ||
return [ | ||
operations.DropTable( | ||
storage_set=self.storage_set_key, | ||
table_name=self.mv_name, | ||
target=OperationTarget.LOCAL, | ||
), | ||
operations.DropTable( | ||
storage_set=self.storage_set_key, | ||
table_name=self.local_table_name, | ||
target=OperationTarget.LOCAL, | ||
), | ||
operations.DropTable( | ||
storage_set=self.storage_set_key, | ||
table_name=self.dist_table_name, | ||
target=OperationTarget.DISTRIBUTED, | ||
), | ||
] | ||
|
||
def backwards_ops(self) -> Sequence[SqlOperation]: | ||
# we won't go back! | ||
return [] |