queries

package
v0.16.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

runtime/queries/

This package implements pre-defined analytical queries. Each query should adhere to the runtime.Query interface to enable efficient caching and cache invalidation of query results.

Adding a new query

Each query should be defined in a separate file and have its own test file containing at least one unit test and exactly one benchmark. The benchmark should be implemented against the ad_bids test project. See column_topk.go and column_topk_test.go for an example.

Running benchmarks

From the repo root, you can benchmark all queries by running:

go test -bench=. -benchmem ./runtime/queries/...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnTopK

type ColumnTopK struct {
	TableName  string
	ColumnName string
	Agg        string
	K          int
	Result     *runtimev1.TopK
}

func (*ColumnTopK) Deps

func (q *ColumnTopK) Deps() []string

func (*ColumnTopK) Key

func (q *ColumnTopK) Key() string

func (*ColumnTopK) MarshalResult

func (q *ColumnTopK) MarshalResult() any

func (*ColumnTopK) Resolve

func (q *ColumnTopK) Resolve(ctx context.Context, rt *runtime.Runtime, instanceID string, priority int) error

func (*ColumnTopK) UnmarshalResult

func (q *ColumnTopK) UnmarshalResult(v any) error

Jump to

Keyboard shortcuts

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