Skip to content

Commit 34e78bb

Browse files
authored
cleanup(smart_autocomplete): remove smart autocomplete mv (#6867)
* Takes up too much space * full table scan if the attribute doesn't exist
1 parent a975d0e commit 34e78bb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from typing import Sequence
2+
3+
from snuba.clusters.storage_sets import StorageSetKey
4+
from snuba.migrations import migration, operations
5+
from snuba.migrations.operations import OperationTarget, SqlOperation
6+
7+
8+
class Migration(migration.ClickhouseNodeMigration):
9+
10+
blocking = False
11+
storage_set_key = StorageSetKey.EVENTS_ANALYTICS_PLATFORM
12+
13+
local_table_name = "eap_trace_item_attrs_local"
14+
dist_table_name = "eap_trace_item_attrs_dist"
15+
mv_name = "eap_trace_item_attrs_mv"
16+
17+
def forwards_ops(self) -> Sequence[SqlOperation]:
18+
return [
19+
operations.DropTable(
20+
storage_set=self.storage_set_key,
21+
table_name=self.mv_name,
22+
target=OperationTarget.LOCAL,
23+
),
24+
operations.DropTable(
25+
storage_set=self.storage_set_key,
26+
table_name=self.local_table_name,
27+
target=OperationTarget.LOCAL,
28+
),
29+
operations.DropTable(
30+
storage_set=self.storage_set_key,
31+
table_name=self.dist_table_name,
32+
target=OperationTarget.DISTRIBUTED,
33+
),
34+
]
35+
36+
def backwards_ops(self) -> Sequence[SqlOperation]:
37+
# we won't go back!
38+
return []

0 commit comments

Comments
 (0)