queries

package
v0.50.6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 39 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

View Source
const IsoFormat string = "2006-01-02T15:04:05.000Z"

Variables

View Source
var ErrExportNotSupported = fmt.Errorf("exporting is not supported")
View Source
var ErrForbidden = errors.New("action not allowed")

Functions

func DuckDBCopyExport added in v0.42.0

func DuckDBCopyExport(ctx context.Context, w io.Writer, opts *runtime.ExportOptions, sql string, args []any, filename string, olap drivers.OLAPStore, exportFormat runtimev1.ExportFormat) error

func MetricsViewFromQuery added in v0.44.0

func MetricsViewFromQuery(qryName, qryArgsJSON string) (string, error)

MetricsViewFromQuery extracts the metrics view name from a JSON query based on the query name.

func NiceAndStep added in v0.22.0

func NiceAndStep(start, stop, count float64) (float64, float64, float64)

Returns a new interval with nicer looking bounds covering the given interval and the step relative to the number of ticks (`count` parameter). The new bounds are guaranteed to align with the human-friendly gap between ticks. The gap is a rounded value that is a power of 10 multiplied by 1, 2 or 5. This approach is inspired by d3.js, see d3.nice() function.

func ProtoFromJSON added in v0.41.0

func ProtoFromJSON(qryName, qryArgsJSON string, executionTime *time.Time) (*runtimev1.Query, error)

ProtoFromJSON builds a proto query from a query name, JSON args, and optional execution time.

func ProtoToQuery added in v0.41.0

func ProtoToQuery(q *runtimev1.Query, claims *runtime.SecurityClaims) (runtime.Query, error)

ProtoToQuery builds a runtime query from a proto query and security attributes. NOTE: Pending refactors, this implementation is replicated from handlers in runtime/server.

func ResolveTimeRange added in v0.37.0

func ResolveTimeRange(tr *runtimev1.TimeRange, mv *runtimev1.MetricsViewSpec) (time.Time, time.Time, error)

func WriteCSV added in v0.42.0

func WriteCSV(meta []*runtimev1.MetricsViewColumn, data []*structpb.Struct, writer io.Writer) error

func WriteParquet added in v0.42.0

func WriteParquet(meta []*runtimev1.MetricsViewColumn, data []*structpb.Struct, ioWriter io.Writer) error

func WriteXLSX added in v0.42.0

func WriteXLSX(meta []*runtimev1.MetricsViewColumn, data []*structpb.Struct, writer io.Writer) error

Types

type ColumnCardinality added in v0.17.0

type ColumnCardinality struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         float64
}

func (*ColumnCardinality) Deps added in v0.17.0

func (*ColumnCardinality) Export added in v0.27.3

func (q *ColumnCardinality) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnCardinality) Key added in v0.17.0

func (q *ColumnCardinality) Key() string

func (*ColumnCardinality) MarshalResult added in v0.17.0

func (q *ColumnCardinality) MarshalResult() *runtime.QueryResult

func (*ColumnCardinality) Resolve added in v0.17.0

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

func (*ColumnCardinality) UnmarshalResult added in v0.17.0

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

type ColumnDescriptiveStatistics added in v0.17.0

type ColumnDescriptiveStatistics struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         *runtimev1.NumericStatistics
}

func (*ColumnDescriptiveStatistics) Deps added in v0.17.0

func (*ColumnDescriptiveStatistics) Export added in v0.27.3

func (*ColumnDescriptiveStatistics) Key added in v0.17.0

func (*ColumnDescriptiveStatistics) MarshalResult added in v0.17.0

func (q *ColumnDescriptiveStatistics) MarshalResult() *runtime.QueryResult

func (*ColumnDescriptiveStatistics) Resolve added in v0.17.0

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

func (*ColumnDescriptiveStatistics) UnmarshalResult added in v0.17.0

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

type ColumnNullCount added in v0.17.0

type ColumnNullCount struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         float64
}

func (*ColumnNullCount) Deps added in v0.17.0

func (q *ColumnNullCount) Deps() []*runtimev1.ResourceName

func (*ColumnNullCount) Export added in v0.27.3

func (q *ColumnNullCount) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnNullCount) Key added in v0.17.0

func (q *ColumnNullCount) Key() string

func (*ColumnNullCount) MarshalResult added in v0.17.0

func (q *ColumnNullCount) MarshalResult() *runtime.QueryResult

func (*ColumnNullCount) Resolve added in v0.17.0

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

func (*ColumnNullCount) UnmarshalResult added in v0.17.0

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

type ColumnNumericHistogram added in v0.17.0

type ColumnNumericHistogram struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Method         runtimev1.HistogramMethod
	Threshold      int
	Result         []*runtimev1.NumericHistogramBins_Bin
}

func (*ColumnNumericHistogram) Deps added in v0.17.0

func (*ColumnNumericHistogram) Export added in v0.27.3

func (q *ColumnNumericHistogram) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnNumericHistogram) Key added in v0.17.0

func (q *ColumnNumericHistogram) Key() string

func (*ColumnNumericHistogram) MarshalResult added in v0.17.0

func (q *ColumnNumericHistogram) MarshalResult() *runtime.QueryResult

func (*ColumnNumericHistogram) Resolve added in v0.17.0

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

func (*ColumnNumericHistogram) UnmarshalResult added in v0.17.0

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

type ColumnRugHistogram added in v0.17.0

type ColumnRugHistogram struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         []*runtimev1.NumericOutliers_Outlier
}

func (*ColumnRugHistogram) Deps added in v0.17.0

func (*ColumnRugHistogram) Export added in v0.27.3

func (q *ColumnRugHistogram) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnRugHistogram) Key added in v0.17.0

func (q *ColumnRugHistogram) Key() string

func (*ColumnRugHistogram) MarshalResult added in v0.17.0

func (q *ColumnRugHistogram) MarshalResult() *runtime.QueryResult

func (*ColumnRugHistogram) Resolve added in v0.17.0

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

func (*ColumnRugHistogram) UnmarshalResult added in v0.17.0

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

type ColumnTimeGrain added in v0.17.0

type ColumnTimeGrain struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         runtimev1.TimeGrain
}

func (*ColumnTimeGrain) Deps added in v0.17.0

func (q *ColumnTimeGrain) Deps() []*runtimev1.ResourceName

func (*ColumnTimeGrain) Export added in v0.27.3

func (q *ColumnTimeGrain) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnTimeGrain) Key added in v0.17.0

func (q *ColumnTimeGrain) Key() string

func (*ColumnTimeGrain) MarshalResult added in v0.17.0

func (q *ColumnTimeGrain) MarshalResult() *runtime.QueryResult

func (*ColumnTimeGrain) Resolve added in v0.17.0

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

func (*ColumnTimeGrain) UnmarshalResult added in v0.17.0

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

type ColumnTimeRange added in v0.17.0

type ColumnTimeRange struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         *runtimev1.TimeRangeSummary
}

func (*ColumnTimeRange) Deps added in v0.17.0

func (q *ColumnTimeRange) Deps() []*runtimev1.ResourceName

func (*ColumnTimeRange) Export added in v0.27.3

func (q *ColumnTimeRange) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnTimeRange) Key added in v0.17.0

func (q *ColumnTimeRange) Key() string

func (*ColumnTimeRange) MarshalResult added in v0.17.0

func (q *ColumnTimeRange) MarshalResult() *runtime.QueryResult

func (*ColumnTimeRange) Resolve added in v0.17.0

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

func (*ColumnTimeRange) UnmarshalResult added in v0.17.0

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

type ColumnTimeseries added in v0.17.0

type ColumnTimeseries struct {
	Connector           string                                            `json:"connector"`
	Database            string                                            `json:"database"`
	DatabaseSchema      string                                            `json:"database_schema"`
	TableName           string                                            `json:"table_name"`
	Measures            []*runtimev1.ColumnTimeSeriesRequest_BasicMeasure `json:"measures"`
	TimestampColumnName string                                            `json:"timestamp_column_name"`
	TimeRange           *runtimev1.TimeSeriesTimeRange                    `json:"time_range"`
	Pixels              int32                                             `json:"pixels"`
	SampleSize          int32                                             `json:"sample_size"`
	TimeZone            string                                            `json:"time_zone,omitempty"`
	Result              *ColumnTimeseriesResult                           `json:"-"`
	FirstDayOfWeek      uint32
	FirstMonthOfYear    uint32

	// MetricsView-related fields. These can be removed when MetricsViewTimeSeries is refactored to a standalone implementation.
	MetricsView       *runtimev1.MetricsViewSpec   `json:"-"`
	MetricsViewFilter *runtimev1.MetricsViewFilter `json:"filters"`
	MetricsViewPolicy *runtime.ResolvedSecurity    `json:"security"`
}

func (*ColumnTimeseries) CreateTimestampRollupReduction added in v0.36.0

func (q *ColumnTimeseries) CreateTimestampRollupReduction(
	ctx context.Context,
	rt *runtime.Runtime,
	olap drivers.OLAPStore,
	instanceID string,
	priority int,
	tableName string,
	timestampColumnName string,
	valueColumn string,
) ([]*runtimev1.TimeSeriesValue, error)

*

  • Contains an as-of-this-commit unpublished algorithm for an M4-like line density reduction.
  • This will take in an n-length time series and produce a pixels * 4 reduction of the time series
  • that preserves the shape and trends. *
  • This algorithm expects the source table to have a timestamp column and some kind of value column,
  • meaning it expects the data to essentially already be aggregated. *
  • It's important to note that this implemention is NOT the original M4 aggregation method, but a method
  • that has the same basic understanding but is much faster. *
  • Nonetheless, we mostly use this to reduce a many-thousands-point-long time series to about 120 * 4 pixels.
  • Importantly, this function runs very fast. For more information about the original M4 method,
  • see http://www.vldb.org/pvldb/vol7/p797-jugel.pdf

func (*ColumnTimeseries) Deps added in v0.17.0

func (*ColumnTimeseries) Export added in v0.27.3

func (q *ColumnTimeseries) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnTimeseries) Key added in v0.17.0

func (q *ColumnTimeseries) Key() string

func (*ColumnTimeseries) MarshalResult added in v0.17.0

func (q *ColumnTimeseries) MarshalResult() *runtime.QueryResult

func (*ColumnTimeseries) Resolve added in v0.17.0

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

func (*ColumnTimeseries) ResolveNormaliseTimeRange added in v0.36.0

func (q *ColumnTimeseries) ResolveNormaliseTimeRange(ctx context.Context, rt *runtime.Runtime, instanceID string, priority int) (*runtimev1.TimeSeriesTimeRange, error)

func (*ColumnTimeseries) UnmarshalResult added in v0.17.0

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

type ColumnTimeseriesResult added in v0.21.0

type ColumnTimeseriesResult struct {
	Meta       []*runtimev1.MetricsViewColumn
	Results    []*runtimev1.TimeSeriesValue
	Spark      []*runtimev1.TimeSeriesValue
	TimeRange  *runtimev1.TimeSeriesTimeRange
	SampleSize int32
}

type ColumnTopK

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

func (*ColumnTopK) Deps

func (q *ColumnTopK) Deps() []*runtimev1.ResourceName

func (*ColumnTopK) Export added in v0.27.3

func (q *ColumnTopK) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ColumnTopK) Key

func (q *ColumnTopK) Key() string

func (*ColumnTopK) MarshalResult

func (q *ColumnTopK) MarshalResult() *runtime.QueryResult

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

type ExpressionBuilder added in v0.44.0

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

type MetricsViewAggregation added in v0.33.2

type MetricsViewAggregation struct {
	MetricsViewName     string                                         `json:"metrics_view,omitempty"`
	Dimensions          []*runtimev1.MetricsViewAggregationDimension   `json:"dimensions,omitempty"`
	Measures            []*runtimev1.MetricsViewAggregationMeasure     `json:"measures,omitempty"`
	Sort                []*runtimev1.MetricsViewAggregationSort        `json:"sort,omitempty"`
	TimeRange           *runtimev1.TimeRange                           `json:"time_range,omitempty"`
	ComparisonTimeRange *runtimev1.TimeRange                           `json:"comparison_time_range,omitempty"`
	Where               *runtimev1.Expression                          `json:"where,omitempty"`
	WhereSQL            string                                         `json:"where_sql,omitempty"`
	Having              *runtimev1.Expression                          `json:"having,omitempty"`
	HavingSQL           string                                         `json:"having_sql,omitempty"`
	Filter              *runtimev1.MetricsViewFilter                   `json:"filter,omitempty"` // Backwards compatibility
	Priority            int32                                          `json:"priority,omitempty"`
	Limit               *int64                                         `json:"limit,omitempty"`
	Offset              int64                                          `json:"offset,omitempty"`
	PivotOn             []string                                       `json:"pivot_on,omitempty"`
	SecurityClaims      *runtime.SecurityClaims                        `json:"security_claims,omitempty"`
	Aliases             []*runtimev1.MetricsViewComparisonMeasureAlias `json:"aliases,omitempty"`
	Exact               bool                                           `json:"exact,omitempty"`

	Result    *runtimev1.MetricsViewAggregationResponse `json:"-"`
	Exporting bool                                      `json:"-"` // Deprecated: Remove when tests call Export directly
}

func (*MetricsViewAggregation) Deps added in v0.33.2

func (*MetricsViewAggregation) Export added in v0.33.2

func (q *MetricsViewAggregation) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewAggregation) Key added in v0.33.2

func (q *MetricsViewAggregation) Key() string

func (*MetricsViewAggregation) MarshalResult added in v0.33.2

func (q *MetricsViewAggregation) MarshalResult() *runtime.QueryResult

func (*MetricsViewAggregation) Resolve added in v0.33.2

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

func (*MetricsViewAggregation) UnmarshalResult added in v0.33.2

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

type MetricsViewComparison added in v0.37.0

type MetricsViewComparison struct {
	MetricsViewName     string                                         `json:"metrics_view_name,omitempty"`
	DimensionName       string                                         `json:"dimension_name,omitempty"`
	Measures            []*runtimev1.MetricsViewAggregationMeasure     `json:"measures,omitempty"`
	ComparisonMeasures  []string                                       `json:"comparison_measures,omitempty"`
	TimeRange           *runtimev1.TimeRange                           `json:"base_time_range,omitempty"`
	ComparisonTimeRange *runtimev1.TimeRange                           `json:"comparison_time_range,omitempty"`
	Limit               int64                                          `json:"limit,omitempty"`
	Offset              int64                                          `json:"offset,omitempty"`
	Sort                []*runtimev1.MetricsViewComparisonSort         `json:"sort,omitempty"`
	Where               *runtimev1.Expression                          `json:"where,omitempty"`
	WhereSQL            string                                         `json:"where_sql,omitempty"`
	Having              *runtimev1.Expression                          `json:"having,omitempty"`
	HavingSQL           string                                         `json:"having_sql,omitempty"`
	Filter              *runtimev1.MetricsViewFilter                   `json:"filter"` // Backwards compatibility
	Aliases             []*runtimev1.MetricsViewComparisonMeasureAlias `json:"aliases,omitempty"`
	Exact               bool                                           `json:"exact"`
	SecurityClaims      *runtime.SecurityClaims                        `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewComparisonResponse `json:"-"`
	// contains filtered or unexported fields
}

func (*MetricsViewComparison) Deps added in v0.37.0

func (*MetricsViewComparison) Export added in v0.37.0

func (q *MetricsViewComparison) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewComparison) Key added in v0.37.0

func (q *MetricsViewComparison) Key() string

func (*MetricsViewComparison) MarshalResult added in v0.37.0

func (q *MetricsViewComparison) MarshalResult() *runtime.QueryResult

func (*MetricsViewComparison) Resolve added in v0.37.0

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

func (*MetricsViewComparison) UnmarshalResult added in v0.37.0

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

type MetricsViewRows added in v0.24.4

type MetricsViewRows struct {
	MetricsViewName    string                       `json:"metrics_view_name,omitempty"`
	TimeStart          *timestamppb.Timestamp       `json:"time_start,omitempty"`
	TimeEnd            *timestamppb.Timestamp       `json:"time_end,omitempty"`
	TimeGranularity    runtimev1.TimeGrain          `json:"time_granularity,omitempty"`
	Where              *runtimev1.Expression        `json:"where,omitempty"`
	Sort               []*runtimev1.MetricsViewSort `json:"sort,omitempty"`
	Limit              *int64                       `json:"limit,omitempty"`
	Offset             int64                        `json:"offset,omitempty"`
	TimeZone           string                       `json:"time_zone,omitempty"`
	MetricsView        *runtimev1.MetricsViewSpec   `json:"-"`
	ResolvedMVSecurity *runtime.ResolvedSecurity    `json:"security"`

	// backwards compatibility
	Filter *runtimev1.MetricsViewFilter `json:"filter,omitempty"`

	Result *runtimev1.MetricsViewRowsResponse `json:"-"`
}

func (*MetricsViewRows) Deps added in v0.24.4

func (q *MetricsViewRows) Deps() []*runtimev1.ResourceName

func (*MetricsViewRows) Export added in v0.27.3

func (q *MetricsViewRows) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewRows) Key added in v0.24.4

func (q *MetricsViewRows) Key() string

func (*MetricsViewRows) MarshalResult added in v0.24.4

func (q *MetricsViewRows) MarshalResult() *runtime.QueryResult

func (*MetricsViewRows) Resolve added in v0.24.4

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

func (*MetricsViewRows) UnmarshalResult added in v0.24.4

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

type MetricsViewSchema added in v0.40.0

type MetricsViewSchema struct {
	MetricsViewName string                  `json:"metrics_view_name,omitempty"`
	SecurityClaims  *runtime.SecurityClaims `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewSchemaResponse `json:"-"`
}

func (*MetricsViewSchema) Deps added in v0.40.0

func (*MetricsViewSchema) Export added in v0.40.0

func (q *MetricsViewSchema) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewSchema) Key added in v0.40.0

func (q *MetricsViewSchema) Key() string

func (*MetricsViewSchema) MarshalResult added in v0.40.0

func (q *MetricsViewSchema) MarshalResult() *runtime.QueryResult

func (*MetricsViewSchema) Resolve added in v0.40.0

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

func (*MetricsViewSchema) UnmarshalResult added in v0.40.0

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

type MetricsViewSearch added in v0.47.0

type MetricsViewSearch struct {
	MetricsViewName string                  `json:"metrics_view_name,omitempty"`
	Dimensions      []string                `json:"dimensions,omitempty"`
	Search          string                  `json:"search,omitempty"`
	TimeRange       *runtimev1.TimeRange    `json:"time_range,omitempty"`
	Where           *runtimev1.Expression   `json:"where,omitempty"`
	Having          *runtimev1.Expression   `json:"having,omitempty"`
	Priority        int32                   `json:"priority,omitempty"`
	Limit           *int64                  `json:"limit,omitempty"`
	SecurityClaims  *runtime.SecurityClaims `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewSearchResponse
}

func (*MetricsViewSearch) Deps added in v0.47.0

func (*MetricsViewSearch) Export added in v0.47.0

func (q *MetricsViewSearch) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewSearch) Key added in v0.47.0

func (q *MetricsViewSearch) Key() string

func (*MetricsViewSearch) MarshalResult added in v0.47.0

func (q *MetricsViewSearch) MarshalResult() *runtime.QueryResult

func (*MetricsViewSearch) Resolve added in v0.47.0

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

func (*MetricsViewSearch) UnmarshalResult added in v0.47.0

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

type MetricsViewTimeRange added in v0.32.0

type MetricsViewTimeRange struct {
	MetricsViewName    string                     `json:"name"`
	MetricsView        *runtimev1.MetricsViewSpec `json:"-"`
	ResolvedMVSecurity *runtime.ResolvedSecurity  `json:"security"`

	Result *runtimev1.MetricsViewTimeRangeResponse `json:"_"`
}

func (*MetricsViewTimeRange) Deps added in v0.32.0

func (*MetricsViewTimeRange) Export added in v0.32.0

func (q *MetricsViewTimeRange) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewTimeRange) Key added in v0.32.0

func (q *MetricsViewTimeRange) Key() string

func (*MetricsViewTimeRange) MarshalResult added in v0.32.0

func (q *MetricsViewTimeRange) MarshalResult() *runtime.QueryResult

func (*MetricsViewTimeRange) Resolve added in v0.32.0

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

func (*MetricsViewTimeRange) UnmarshalResult added in v0.32.0

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

type MetricsViewTimeSeries added in v0.17.0

type MetricsViewTimeSeries struct {
	MetricsViewName string                       `json:"metrics_view_name,omitempty"`
	MeasureNames    []string                     `json:"measure_names,omitempty"`
	TimeStart       *timestamppb.Timestamp       `json:"time_start,omitempty"`
	TimeEnd         *timestamppb.Timestamp       `json:"time_end,omitempty"`
	Limit           int64                        `json:"limit,omitempty"`
	Offset          int64                        `json:"offset,omitempty"`
	Sort            []*runtimev1.MetricsViewSort `json:"sort,omitempty"`
	Where           *runtimev1.Expression        `json:"where,omitempty"`
	WhereSQL        string                       `json:"where_sql,omitempty"`
	Filter          *runtimev1.MetricsViewFilter `json:"filter,omitempty"` // backwards compatibility
	Having          *runtimev1.Expression        `json:"having,omitempty"`
	HavingSQL       string                       `json:"having_sql,omitempty"`
	TimeGranularity runtimev1.TimeGrain          `json:"time_granularity,omitempty"`
	TimeZone        string                       `json:"time_zone,omitempty"`
	SecurityClaims  *runtime.SecurityClaims      `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewTimeSeriesResponse `json:"-"`
}

func (*MetricsViewTimeSeries) Deps added in v0.17.0

func (*MetricsViewTimeSeries) Export added in v0.27.3

func (q *MetricsViewTimeSeries) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewTimeSeries) Key added in v0.17.0

func (q *MetricsViewTimeSeries) Key() string

func (*MetricsViewTimeSeries) MarshalResult added in v0.17.0

func (q *MetricsViewTimeSeries) MarshalResult() *runtime.QueryResult

func (*MetricsViewTimeSeries) Resolve added in v0.17.0

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

func (*MetricsViewTimeSeries) UnmarshalResult added in v0.17.0

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

type MetricsViewToplist added in v0.17.0

type MetricsViewToplist struct {
	MetricsViewName string                       `json:"metrics_view_name,omitempty"`
	DimensionName   string                       `json:"dimension_name,omitempty"`
	MeasureNames    []string                     `json:"measure_names,omitempty"`
	TimeStart       *timestamppb.Timestamp       `json:"time_start,omitempty"`
	TimeEnd         *timestamppb.Timestamp       `json:"time_end,omitempty"`
	Limit           *int64                       `json:"limit,omitempty"`
	Offset          int64                        `json:"offset,omitempty"`
	Sort            []*runtimev1.MetricsViewSort `json:"sort,omitempty"`
	Where           *runtimev1.Expression        `json:"where,omitempty"`
	WhereSQL        string                       `json:"where_sql,omitempty"`
	Filter          *runtimev1.MetricsViewFilter `json:"filter,omitempty"` // backwards compatibility
	Having          *runtimev1.Expression        `json:"having,omitempty"`
	HavingSQL       string                       `json:"having_sql,omitempty"`
	SecurityClaims  *runtime.SecurityClaims      `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewToplistResponse `json:"-"`
}

func (*MetricsViewToplist) Deps added in v0.17.0

func (*MetricsViewToplist) Export added in v0.27.3

func (q *MetricsViewToplist) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewToplist) Key added in v0.17.0

func (q *MetricsViewToplist) Key() string

func (*MetricsViewToplist) MarshalResult added in v0.17.0

func (q *MetricsViewToplist) MarshalResult() *runtime.QueryResult

func (*MetricsViewToplist) Resolve added in v0.17.0

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

func (*MetricsViewToplist) UnmarshalResult added in v0.17.0

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

type MetricsViewTotals added in v0.17.0

type MetricsViewTotals struct {
	MetricsViewName string                       `json:"metrics_view_name,omitempty"`
	MeasureNames    []string                     `json:"measure_names,omitempty"`
	TimeStart       *timestamppb.Timestamp       `json:"time_start,omitempty"`
	TimeEnd         *timestamppb.Timestamp       `json:"time_end,omitempty"`
	Where           *runtimev1.Expression        `json:"where,omitempty"`
	WhereSQL        string                       `json:"where_sql,omitempty"`
	Filter          *runtimev1.MetricsViewFilter `json:"filter,omitempty"` // backwards compatibility
	SecurityClaims  *runtime.SecurityClaims      `json:"security_claims,omitempty"`

	Result *runtimev1.MetricsViewTotalsResponse `json:"-"`
}

func (*MetricsViewTotals) Deps added in v0.17.0

func (*MetricsViewTotals) Export added in v0.27.3

func (q *MetricsViewTotals) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*MetricsViewTotals) Key added in v0.17.0

func (q *MetricsViewTotals) Key() string

func (*MetricsViewTotals) MarshalResult added in v0.17.0

func (q *MetricsViewTotals) MarshalResult() *runtime.QueryResult

func (*MetricsViewTotals) Resolve added in v0.17.0

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

func (*MetricsViewTotals) UnmarshalResult added in v0.17.0

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

type ResourceWatermark added in v0.41.0

type ResourceWatermark struct {
	ResourceKind string     `json:"resource_kind,omitempty"`
	ResourceName string     `json:"resource_name,omitempty"`
	Result       *time.Time `json:"-"`
}

func (*ResourceWatermark) Deps added in v0.41.0

func (*ResourceWatermark) Export added in v0.41.0

func (q *ResourceWatermark) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*ResourceWatermark) Key added in v0.41.0

func (q *ResourceWatermark) Key() string

func (*ResourceWatermark) MarshalResult added in v0.41.0

func (q *ResourceWatermark) MarshalResult() *runtime.QueryResult

func (*ResourceWatermark) Resolve added in v0.41.0

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

func (*ResourceWatermark) UnmarshalResult added in v0.41.0

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

type RollupInterval added in v0.17.0

type RollupInterval struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	ColumnName     string
	Result         *runtimev1.ColumnRollupIntervalResponse
}

func (*RollupInterval) Deps added in v0.17.0

func (q *RollupInterval) Deps() []*runtimev1.ResourceName

func (*RollupInterval) Export added in v0.27.3

func (q *RollupInterval) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*RollupInterval) Key added in v0.17.0

func (q *RollupInterval) Key() string

func (*RollupInterval) MarshalResult added in v0.17.0

func (q *RollupInterval) MarshalResult() *runtime.QueryResult

func (*RollupInterval) Resolve added in v0.17.0

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

func (*RollupInterval) UnmarshalResult added in v0.17.0

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

type TableCardinality added in v0.17.0

type TableCardinality struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	Result         int64
}

func (*TableCardinality) Deps added in v0.17.0

func (*TableCardinality) Export added in v0.27.3

func (q *TableCardinality) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*TableCardinality) Key added in v0.17.0

func (q *TableCardinality) Key() string

func (*TableCardinality) MarshalResult added in v0.17.0

func (q *TableCardinality) MarshalResult() *runtime.QueryResult

func (*TableCardinality) Resolve added in v0.17.0

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

func (*TableCardinality) UnmarshalResult added in v0.17.0

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

type TableColumns added in v0.17.0

type TableColumns struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	Result         *runtimev1.TableColumnsResponse
}

func (*TableColumns) Deps added in v0.17.0

func (q *TableColumns) Deps() []*runtimev1.ResourceName

func (*TableColumns) Export added in v0.27.3

func (q *TableColumns) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*TableColumns) Key added in v0.17.0

func (q *TableColumns) Key() string

func (*TableColumns) MarshalResult added in v0.17.0

func (q *TableColumns) MarshalResult() *runtime.QueryResult

func (*TableColumns) Resolve added in v0.17.0

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

func (*TableColumns) UnmarshalResult added in v0.17.0

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

type TableHead added in v0.21.1

type TableHead struct {
	Connector      string
	Database       string
	DatabaseSchema string
	TableName      string
	Limit          int
	Result         []*structpb.Struct
	Schema         *runtimev1.StructType
}

func (*TableHead) Deps added in v0.21.1

func (q *TableHead) Deps() []*runtimev1.ResourceName

func (*TableHead) Export added in v0.27.3

func (q *TableHead) Export(ctx context.Context, rt *runtime.Runtime, instanceID string, w io.Writer, opts *runtime.ExportOptions) error

func (*TableHead) Key added in v0.21.1

func (q *TableHead) Key() string

func (*TableHead) MarshalResult added in v0.21.1

func (q *TableHead) MarshalResult() *runtime.QueryResult

func (*TableHead) Resolve added in v0.21.1

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

func (*TableHead) UnmarshalResult added in v0.21.1

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

Jump to

Keyboard shortcuts

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