Versions in this module Expand all Collapse all v1 v1.6.65 Sep 23, 2024 Changes in this version + func ExtractFromWhereAndvisibilityFilter(s string) (table string, whereClause string, visibilityFilter string) v1.6.64 Sep 13, 2024 v1.6.4 Sep 13, 2024 Changes in this version + const INTERVAL_1D + const TAG_FUNCTION_ANY + const TAG_FUNCTION_COUNT_DISTINCT + const TAG_FUNCTION_ENUM + const TAG_FUNCTION_FAST_FILTER + const TAG_FUNCTION_FAST_TRANS + const TAG_FUNCTION_ICON_ID + const TAG_FUNCTION_IF + const TAG_FUNCTION_MASK + const TAG_FUNCTION_NEW_TAG + const TAG_FUNCTION_NODE_TYPE + const TAG_FUNCTION_TIME + const TAG_FUNCTION_TOPK + const TAG_FUNCTION_TO_STRING + const TAG_FUNCTION_TO_UNIX_TIMESTAMP + const TAG_FUNCTION_TO_UNIX_TIMESTAMP_64_MICRO + const TAG_FUNCTION_UNIQ + var DEFAULT_LIMIT = "10000" + var INVALID_PROMETHEUS_SUBQUERY_CACHE_ENTRY = "-1" + var Lock sync.Mutex + var TAG_FUNCTIONS = []string + var TIME_FILL_LIMIT_DEFAULT = 20 + func ColumnNameSwap(args []interface{}) func(result *common.Result) error + func ExtractFromWhere(s string) (table string, whereClause string) + func FormatInnerTime(m *view.Model) + func FormatLimit(m *view.Model) + func FormatModel(m *view.Model) + func GetDatabases() *common.Result + func GetDefaultAlias(name string, args []string) string + func GetMetricIDFilter(e *CHEngine) (view.Node, error) + func GetNotNullFilter(name string, e *CHEngine) (view.Node, bool) + func GetPrometheusAllTagTranslator(e *CHEngine) (string, string, error) + func GetPrometheusFilter(promTag, table, op, value string, e *CHEngine) (string, error) + func GetPrometheusGroup(name string, e *CHEngine) string + func GetPrometheusNotNullFilter(name string, e *CHEngine) (view.Node, bool) + func GetPrometheusSingleTagTranslator(tag string, e *CHEngine) (string, string, error) + func GetRemoteReadFilter(promTag, table, op, value, originFilter string, e *CHEngine) (string, error) + func GetTables(db, queryCacheTTL, orgID string, useQueryCache bool, ctx context.Context, ...) *common.Result + func GetVirtualTableFilter(db, table string) (view.Node, bool) + func LoadDbDescriptions(dbDescriptions map[string]interface{}) error + func MacTranslate(args []interface{}) func(result *common.Result) error + func MatchPattern(s string) (int, bool) + func ShowTagTypeMetrics(tagDescriptions, result *common.Result, db, table string) + func SimpleExecute(args *common.QuerierParams) (result *common.Result, debug map[string]interface{}, err error) + func TimeFill(args []interface{}) func(result *common.Result) error + func TransAlertEventNoSuffixFilter(translator, regexpTranslator, op, value string) (filter string) + func TransChostFilter(translator, regexpTranslator, op, value string) (filter string) + func TransEnvFilter(translator, regexpTranslator, key, op, value string) (filter string) + func TransIngressFilter(translator, regexpTranslator, op, value string) (filter string) + func TransLabelFilter(translator, regexpTranslator, key, op, value string) (filter string) + func TransTagFilter(whereTag, postAsTag, value, op, db, table, originFilter string, ...) (filter string, err error) + func TransWhereTagFunction(db, table string, name string, args []string) (filter string) + type AggFunction struct + Alias string + Args []string + DerivativeArgs []string + DerivativeGroupBy []string + IsDerivative bool + Metrics *metrics.Metrics + Name string + func (f *AggFunction) Format(m *view.Model) + func (f *AggFunction) FormatInnerTag(m *view.Model) (innerAlias string) + func (f *AggFunction) SetAlias(alias string) + func (f *AggFunction) Trans(m *view.Model) view.Node + type BinaryFunction struct + Alias string + Functions []Function + Name string + func GetBinaryFunc(name string, args []Function) (*BinaryFunction, error) + func (f *BinaryFunction) Format(m *view.Model) + func (f *BinaryFunction) SetAlias(alias string) + func (f *BinaryFunction) Trans(m *view.Model) view.Node + type CHEngine struct + AsTagMap map[string]string + ColumnSchemas []*common.ColumnSchema + Context context.Context + DB string + DataSource string + DerivativeGroupBy []string + IsDerivative bool + Model *view.Model + NoPreWhere bool + ORGID string + Statements []Statement + Table string + TargetLabelFilters []TargetLabelFilter + View *view.View + func (e *CHEngine) AddGroup(group string) error + func (e *CHEngine) AddTable(table string) + func (e *CHEngine) AddTag(tag string, alias string) (string, error) + func (e *CHEngine) ExecuteQuery(args *common.QuerierParams) (*common.Result, map[string]interface{}, error) + func (e *CHEngine) Init() + func (e *CHEngine) ParseShowSql(sql string, args *common.QuerierParams, DebugInfo *client.DebugInfo) (*common.Result, []string, bool, error) + func (e *CHEngine) ParseSlimitSql(sql string, args *common.QuerierParams) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...) + func (e *CHEngine) ParseWithSql(sql string) (string, map[string]func(*common.Result) error, map[string]*common.ColumnSchema, ...) + func (e *CHEngine) QuerySlimitSql(sql string, args *common.QuerierParams) (*common.Result, *client.Debug, error) + func (e *CHEngine) QueryWithSql(sql string, args *common.QuerierParams) (*common.Result, *client.Debug, error) + func (e *CHEngine) SetLevelFlag(flag int) + func (e *CHEngine) ToSQLString() string + func (e *CHEngine) TransDerivativeGroupBy(groups sqlparser.GroupBy) error + func (e *CHEngine) TransFrom(froms sqlparser.TableExprs) error + func (e *CHEngine) TransGroupBy(groups sqlparser.GroupBy) error + func (e *CHEngine) TransHaving(node *sqlparser.Where) error + func (e *CHEngine) TransLimit(limit *sqlparser.Limit) error + func (e *CHEngine) TransOrderBy(orders sqlparser.OrderBy) error + func (e *CHEngine) TransPrometheusTargetIDFilter(expr view.Node) (view.Node, error) + func (e *CHEngine) TransSelect(tags sqlparser.SelectExprs) error + func (e *CHEngine) TransWhere(node *sqlparser.Where) error + type Callback struct + Args []interface{} + Column string + Function func([]interface{}) func(*common.Result) error + func (c *Callback) Format(m *view.Model) + type Field struct + Value string + func (f *Field) Format(m *view.Model) + func (f *Field) SetAlias(alias string) + func (f *Field) Trans(m *view.Model) view.Node + type FieldFunction interface + func GetFieldFunc(name string) (FieldFunction, error) + type Function interface + SetAlias func(alias string) + Trans func(m *view.Model) view.Node + type GroupTag struct + Alias string + AsTagMap map[string]string + Value string + Withs []view.Node + func (g *GroupTag) Format(m *view.Model) + type Having struct + func (h *Having) Format(m *view.Model) + type PrometheusSubqueryCache struct + Lock sync.Mutex + PrometheusSubqueryCache *lru.Cache[common.EntryKey, common.EntryValue] + func GetPrometheusSubqueryCache() *PrometheusSubqueryCache + func (c *PrometheusSubqueryCache) Add(key common.EntryKey, value common.EntryValue) + func (c *PrometheusSubqueryCache) Get(key common.EntryKey) (value common.EntryValue, ok bool) + type SelectTag struct + Alias string + Flag int + Value string + Withs []view.Node + func (t *SelectTag) Format(m *view.Model) + type Statement interface + Format func(*view.Model) + func GetAggFunc(name string, args []string, alias string, derivativeArgs []string, e *CHEngine) (Statement, int, string, error) + func GetDefaultTag(name string, alias string) Statement + func GetGroup(name string, e *CHEngine) ([]Statement, error) + func GetMetricsTag(name string, alias string, e *CHEngine) (Statement, error) + func GetTagFunction(name string, args []string, alias string, e *CHEngine) (Statement, error) + func GetTagTranslator(name, alias string, e *CHEngine) ([]Statement, string, error) + func GetTopKTrans(name string, args []string, alias string, e *CHEngine) (Statement, int, string, error) + type Table struct + Value string + func (t *Table) Format(m *view.Model) + type TagFunction struct + Alias string + Args []string + DB string + Engine *CHEngine + Name string + Table string + Value string + Withs []view.Node + func (f *TagFunction) Check() error + func (f *TagFunction) Format(m *view.Model) + func (f *TagFunction) SetAlias(alias string) + func (f *TagFunction) Trans(m *view.Model) view.Node + type TargetLabelFilter struct + OriginFilter string + TransFilter string + type Time struct + Alias string + Args []string + Fill string + Interval int + Offset int + TimeField string + WindowSize int + Withs []view.Node + func (t *Time) Format(m *view.Model) + func (t *Time) Trans(m *view.Model) error + type TimeIntervalField struct + func (f *TimeIntervalField) Format(m *view.Model) + func (f *TimeIntervalField) SetAlias(alias string) + func (f *TimeIntervalField) Trans(m *view.Model) view.Node + type TimeTag struct + Value string + func (t *TimeTag) Trans(expr sqlparser.Expr, w *Where, e *CHEngine) (view.Node, error) + type Where struct + func (w *Where) Format(m *view.Model) + type WhereFunction struct + Function view.Node + Value string + func (f *WhereFunction) Trans(expr sqlparser.Expr, w *Where, asTagMap map[string]string, db, table string) (view.Node, error) + type WhereStatement interface + Trans func(sqlparser.Expr, *Where, *CHEngine) (view.Node, error) + func GetWhere(name, value string) WhereStatement + type WhereTag struct + Tag string + Value string + func (t *WhereTag) Trans(expr sqlparser.Expr, w *Where, e *CHEngine) (view.Node, error)