Exemple #1
0
 def backwards_local(self) -> Sequence[operations.SqlOperation]:
     return [
         operations.DropTable(
             storage_set=StorageSetKey.METRICS,
             table_name=get_consolidated_mv_name("sets"),
         )
     ]
Exemple #2
0
 def forwards_local(self) -> Sequence[operations.SqlOperation]:
     return (get_forward_view_migration_local_consolidated(
         source_table_name="metrics_counters_buckets_local",
         table_name="metrics_counters_local",
         mv_name=get_consolidated_mv_name("counters"),
         aggregation_col_schema=[
             Column("value", AggregateFunction("sum", [Float(64)])),
         ],
         aggregation_states="sumState(value) as value",
     ), )
Exemple #3
0
 def forwards_local(self) -> Sequence[operations.SqlOperation]:
     return (get_forward_view_migration_local_consolidated(
         source_table_name="metrics_buckets_local",
         table_name="metrics_sets_local",
         mv_name=get_consolidated_mv_name("sets"),
         aggregation_col_schema=[
             Column("value", AggregateFunction("uniqCombined64",
                                               [UInt(64)])),
         ],
         aggregation_states=
         "uniqCombined64State(arrayJoin(set_values)) as value",
     ), )
 def forwards_local(self) -> Sequence[operations.SqlOperation]:
     return (get_forward_view_migration_local_consolidated(
         source_table_name="metrics_distributions_buckets_local",
         table_name="metrics_distributions_local",
         mv_name=get_consolidated_mv_name("distributions"),
         aggregation_col_schema=COL_SCHEMA_DISTRIBUTIONS,
         aggregation_states=
         ("quantilesState(0.5, 0.75, 0.9, 0.95, 0.99)((arrayJoin(values) AS values_rows)) as percentiles, "
          "minState(values_rows) as min, "
          "maxState(values_rows) as max, "
          "avgState(values_rows) as avg, "
          "sumState(values_rows) as sum, "
          "countState(values_rows) as count"),
     ), )