Skip to content

Commit

Permalink
feat: supports creating 1h, 1d aggregate data source when using ByConity
Browse files Browse the repository at this point in the history
  • Loading branch information
lzf575 committed Dec 4, 2024
1 parent b29c46f commit 3ccea74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions server/ingester/pkg/ckwriter/ckwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ func initTable(conn clickhouse.Conn, timeZone string, t *ckdb.Table, orgID uint1
return err
}

// after Byconity creates the '1h' and '1d' tables, the query for the '1m' table will fail
if t.Aggr1H1D && t.DBType != ckdb.CKDBTypeByconity {
if t.Aggr1H1D {
if err := ExecSQL(conn, t.MakeAggrTableCreateSQL1H(orgID)); err != nil {
log.Warningf("create 1h agg table failed: %s", err)
}
Expand Down
4 changes: 1 addition & 3 deletions server/libs/ckdb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ func (a AggregationInterval) ByconityBaseTable() string {
switch a {
case AggregationMinute:
return "1s"
case AggregationHour:
case AggregationHour, AggregationDay:
return "1m"
case AggregationDay:
return "1h_agg"
default:
return "unkunown aggregation byconity base table"
}
Expand Down

0 comments on commit 3ccea74

Please sign in to comment.