mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
common/clickhousedb: disable experimental analyzer, only when using FILL
This commit is contained in:
@@ -55,9 +55,6 @@ func New(r *reporter.Reporter, config Configuration, dependencies Dependencies)
|
||||
MaxOpenConns: config.MaxOpenConns,
|
||||
MaxIdleConns: config.MaxOpenConns/2 + 1,
|
||||
ConnMaxLifetime: time.Hour,
|
||||
Settings: clickhouse.Settings{
|
||||
"allow_experimental_analyzer": 0,
|
||||
},
|
||||
ClientInfo: clickhouse.ClientInfo{
|
||||
Products: []struct {
|
||||
Name string
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ClickHouse/clickhouse-go/v2"
|
||||
"github.com/gin-gonic/gin"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
@@ -249,6 +250,9 @@ func (c *Component) graphLineHandlerFunc(gc *gin.Context) {
|
||||
Xps float64 `ch:"xps"`
|
||||
Dimensions []string `ch:"dimensions"`
|
||||
}{}
|
||||
ctx = clickhouse.Context(ctx, clickhouse.WithSettings(clickhouse.Settings{
|
||||
"allow_experimental_analyzer": 0,
|
||||
}))
|
||||
if err := c.d.ClickHouseDB.Conn.Select(ctx, &results, sqlQuery); err != nil {
|
||||
c.r.Err(err).Str("query", sqlQuery).Msg("unable to query database")
|
||||
gc.JSON(http.StatusInternalServerError, gin.H{"message": "Unable to query database."})
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user