Help us shape the future of Go! Take the 2026 Go Developer Survey

engine

package
v3.6.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("feature not supported in new query engine")

Functions

func IsQuerySupported

func IsQuerySupported(params logql.Params) bool

Types

type Config

type Config struct {
	// Enable the next generation Loki Query Engine for supported queries.
	Enable bool `yaml:"enable" category:"experimental"`

	DataobjStorageLag   time.Duration      `yaml:"dataobj_storage_lag" category:"experimental"`
	DataobjStorageStart dskit_flagext.Time `yaml:"dataobj_storage_start" category:"experimental"`

	// Batch size of the v2 execution engine.
	BatchSize int `yaml:"batch_size" category:"experimental"`

	// MergePrefetchCount controls the number of inputs that are prefetched simultaneously by any Merge node.
	MergePrefetchCount int `yaml:"merge_prefetch_count" category:"experimental"`

	// RangeConfig determines how to optimize range reads in the V2 engine.
	RangeConfig rangeio.Config `` /* 141-byte string literal not displayed */
}

Config holds the configuration options to use with the next generation Loki Query Engine.

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

func (*Config) ValidQueryRange

func (cfg *Config) ValidQueryRange() (time.Time, time.Time)

type QueryEngine

type QueryEngine struct {
	// contains filtered or unexported fields
}

QueryEngine combines logical planning, physical planning, and execution to evaluate LogQL queries.

func New

func New(cfg Config, metastoreCfg metastore.Config, bucket objstore.Bucket, limits logql.Limits, reg prometheus.Registerer, logger log.Logger) *QueryEngine

New creates a new instance of the query engine that implements the logql.Engine interface.

func (*QueryEngine) Execute

func (e *QueryEngine) Execute(ctx context.Context, params logql.Params) (logqlmodel.Result, error)

Execute executes a LogQL query and returns its results or alternatively an error. The execution is done in three steps:

  1. Create a logical plan from the provided query parameters.
  2. Create a physical plan from the logical plan using information from the catalog.
  3. Evaluate the physical plan with the executor.

func (*QueryEngine) Query

func (e *QueryEngine) Query(params logql.Params) logql.Query

Query implements logql.Engine.

type ResultBuilder

type ResultBuilder interface {
	CollectRecord(arrow.Record)
	Build(stats.Result, *metadata.Context) logqlmodel.Result
	Len() int
}

Directories

Path Synopsis
internal
arrowagg
Package arrowagg provides utilities for aggregating Apache Arrow data structures.
Package arrowagg provides utilities for aggregating Apache Arrow data structures.
planner/logical
Package logical provides a logical query plan representation for data processing operations.
Package logical provides a logical query plan representation for data processing operations.
util/dag
Package dag provides utilities for working with directed acyclic graphs (DAGs).
Package dag provides utilities for working with directed acyclic graphs (DAGs).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL