common/clickhousedb: disable experimental analyzer, only when using FILL

This commit is contained in:
Vincent Bernat
2024-04-19 19:51:44 +02:00
parent 12967c8ab6
commit 889f82eb85
3 changed files with 8 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"time"
"github.com/ClickHouse/clickhouse-go/v2"
"github.com/gin-gonic/gin"
"akvorado/common/schema"
@@ -242,6 +243,9 @@ ORDER BY Time WITH FILL
Time time.Time `json:"t"`
Gbps float64 `json:"gbps"`
}{}
ctx = clickhouse.Context(ctx, clickhouse.WithSettings(clickhouse.Settings{
"allow_experimental_analyzer": 0,
}))
err := c.d.ClickHouseDB.Conn.Select(ctx, &results, strings.TrimSpace(query))
if err != nil {
c.r.Err(err).Msg("unable to query database")