Documentation
¶
Overview ¶
Package functions is a collection of built-in functions that are callable in the flux query processor. While flux may be extended at runtime by writing function expressions, there are some limitations for which a built-in function is necessary, such as the need for custom data structures, stateful procedures, complex looping and branching, and connection to external services. Another reason for implementing a built-in function is to provide a function that is broadly applicable for many users (e.g., sum() or max()).
The functions package is rarely accessed as a direct API. Rather, the query processing engine accepts named registrations for various interfaces implemented within the functions package and executes them generically using an API that is common to all functions. The registration process is executed by running the init() function in each function file, and is then finalized by importing package builtin, which itself imports the functions package and runs a final setup routine that finalizes installation of the builtin functions to the query processor.
Because of this design, a built-in function implementation consists of a bundle of different interface implementations that are required at various phases of query execution. These phases are query, plan and execute. The query phase is for identifying initializing the parameter sets for each function, and initializing the internal representation of a query. The plan phase is for creating a final execution plan, and the execution phase is for physically accessing the data and computing a final result.
The query phase takes each function call in a query and performs a match against the registry to see if there are type definitions for a built-in operation. If matched, it will instantiate the correct query.OperationSpec type for that function, given the runtime parameters. If a builtin OperationSpec is not found, then it will check for functions defined at runtime, and otherwise return an error. The following registrations are typically executed in the function's init() for the query phase to execute properly:
query.RegisterFunction(name string, c query.CreateOperationSpec, sig semantic.FunctionSignature) query.RegisterOpSpec(k query.OperationKind, c query.NewOperationSpec)
In the plan phase, an operation spec must be converted to a plan.ProcedureSpec. A query plan must know what operations to carry out, including the function names and parameters. In the trivial case, the OperationSpec and ProcedureSpec have identical fields and the operation spec may be encapsulated as part of the procedure spec. The base interface for a plan.ProcedureSpec requires a Kind() function, as well as a Copy() function which should perform a deep copy of the object. Refer to the following interfaces for more information about designing a procedure spec:
plan.ProcedureSpec plan.PushDownProcedureSpec plan.BoundedProcedureSpec plan.YieldProcedureSpec plan.AggregateProcedureSpec plan.ParentAwareProcedureSpec
Once you have determined the interface(s) that must be implemented for your function, you register them with
plan.RegisterProcedureSpec(k ProcedureKind, c CreateProcedureSpec, qks ...query.OperationKind)
The registration in this phase creates two lookups. First, it creates a named lookup in a similar fashion as for OperationSpecs in the query phase. Second, it creates a mapping from OperationSpec types to ProcedureSpec types so that the collection of OperationSpecs for the query can be quickly converted to corresponding Procedure specs. One feature to note is that the registration takes a list of query.OperationSpec values. This is because several user-facing query functions may map to the same internal procedure.
The primary function of the plan phase is to re-order, re-write and possibly combine the operations described in the incoming query in order to improve the performance of the query execution. The planner has two primary operations for doing this: Pushdowns and ReWrites.
A push down operation is a planning technique for pushing the logic from one operation into another so that only a single composite function needs to be called instead of two simpler function call. A pushdown is implemented by implementing the plan.PushDownProcedureSpec interface, which requires functions that define the rules and methods for executing a pushdown operation.
A Rewrite rule is used to modify one or more ProcedureSpecs in cases where redundant or complementary operations can be combined to get a simpler result. Similar to a pushdown operation, the rewrite is triggered whenever certain rules apply. Rewrite rules are implemented differently and require a separate registration:
plan.RegisterRewriteRule(r RewriteRule)
Which in turn requires an implementation of plan.RewriteRule.
Finally, the execute phase is tasked with executing the specific data processing algorithm for the function. A function implementation registers an implementation of the execute.Transformation interface that implements functions that control how the execution engine will take an input table, apply the function, and produce an output table. A transformation implementation is registered via:
execute.RegisterTransformation(k plan.ProcedureKind, c execute.CreateTransformation)
The registration will record a mapping of the procedure's kind to the given transformation type.
In addition to implementing the transformation type, a number of helper types and functions are provided that facilitate the transformation process:
execute.Administration execute.Dataset execute.TableBuilderCache execute.TableBuilder execute.NewAggregateTransformationAndDataset execute.NewRowSelectorTransformationAndDataset query.Table query.GroupKey query.ColMeta query.ColReader
The most important part of a function implementation is for the interface method execute.Transformation.Process(id execute.DatasetID, tbl query.Table). While the full details of how to implement this function are out of the scope of this document, a typical implementation will do the following: 1. Validate the incoming table schema if needed 2. Construct the column and group key schema for the output table via the table builder. 3. Process the incoming table via query.Table.Do, and use the input data to determine the output rows for the table builder. 4. Add rows to the output table.
Finally, there is a special class of functions do not receive an input table from another function's output. In other words, these transformations do not have a parent process that supplies it with table data. These transformation functions are referred to as sources, and naturally implement a connection to a data source (e.g. influxdb, prometheus, csvFile, etc.). They are registered using:
execute.RegisterSource(k plan.ProcedureKind, c execute.CreateSource)
The substantial part of a source implementation is its Run method, which should connect to the data source, collect its data into query.Table structures, and apply any transformations associated with the source.
Package functions contains the implementations for the builtin functions.
Index ¶
- Constants
- Variables
- func InjectFromDependencies(depsMap execute.Dependencies, deps storage.Dependencies) error
- func NewCumulativeSumTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *cumulativeSumTransformation
- func NewDedupTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DedupProcedureSpec) *dedupTransformation
- func NewDerivativeTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *derivativeTransformation
- func NewDifferenceTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *differenceTransformation
- func NewDistinctTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *distinctTransformation
- func NewFilterTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *FilterProcedureSpec) (*filterTransformation, error)
- func NewFixedWindowTransformation(d execute.Dataset, cache execute.TableBuilderCache, bounds execute.Bounds, ...) execute.Transformation
- func NewGroupTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *GroupProcedureSpec) *groupTransformation
- func NewHistogramTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *histogramTransformation
- func NewHistorgramQuantileTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) execute.Transformation
- func NewIntegralTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) *integralTransformation
- func NewKeysTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *KeysProcedureSpec) *keysTransformation
- func NewLimitTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *LimitProcedureSpec) *limitTransformation
- func NewMapTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *MapProcedureSpec) (*mapTransformation, error)
- func NewMergeJoinTransformation(d execute.Dataset, cache *MergeJoinCache, spec *MergeJoinProcedureSpec, ...) *mergeJoinTransformation
- func NewPivotTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *PivotProcedureSpec) *pivotTransformation
- func NewRangeTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *RangeProcedureSpec, ...) (*rangeTransformation, error)
- func NewSchemaMutationTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec plan.ProcedureSpec) (*schemaMutationTransformation, error)
- func NewSetTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *SetProcedureSpec) execute.Transformation
- func NewShiftTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ShiftProcedureSpec) *shiftTransformation
- func NewSortTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *SortProcedureSpec) *sortTransformation
- func NewStateTrackingTransformation(d execute.Dataset, cache execute.TableBuilderCache, ...) (*stateTrackingTransformation, error)
- func NewUniqueTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *UniqueProcedureSpec) *uniqueTransformation
- func SystemTime() values.Value
- type AggregateGroupRewriteRule
- type BuilderContext
- type CSVSource
- type CountAgg
- func (a *CountAgg) DoBool(vs []bool)
- func (a *CountAgg) DoFloat(vs []float64)
- func (a *CountAgg) DoInt(vs []int64)
- func (a *CountAgg) DoString(vs []string)
- func (a *CountAgg) DoUInt(vs []uint64)
- func (a *CountAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *CountAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *CountAgg) NewIntAgg() execute.DoIntAgg
- func (a *CountAgg) NewStringAgg() execute.DoStringAgg
- func (a *CountAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *CountAgg) Type() query.DataType
- func (a *CountAgg) ValueInt() int64
- type CountOpSpec
- type CountProcedureSpec
- func (s *CountProcedureSpec) AggregateMethod() string
- func (s *CountProcedureSpec) Copy() plan.ProcedureSpec
- func (s *CountProcedureSpec) Kind() plan.ProcedureKind
- func (s *CountProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
- func (s *CountProcedureSpec) PushDownRules() []plan.PushDownRule
- func (s *CountProcedureSpec) ReAggregateSpec() plan.ProcedureSpec
- type CovarianceOpSpec
- type CovarianceProcedureSpec
- type CovarianceTransformation
- func (t *CovarianceTransformation) DoFloat(xs, ys []float64)
- func (t *CovarianceTransformation) Finish(id execute.DatasetID, err error)
- func (t *CovarianceTransformation) Process(id execute.DatasetID, tbl query.Table) error
- func (t *CovarianceTransformation) RetractTable(id execute.DatasetID, key query.GroupKey) error
- func (t *CovarianceTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error
- func (t *CovarianceTransformation) UpdateWatermark(id execute.DatasetID, mark execute.Time) error
- type CumulativeSumOpSpec
- type CumulativeSumProcedureSpec
- type DedupOpSpec
- type DedupProcedureSpec
- type DerivativeOpSpec
- type DerivativeProcedureSpec
- type DifferenceOpSpec
- type DifferenceProcedureSpec
- type DistinctOpSpec
- type DistinctPointLimitRewriteRule
- type DistinctProcedureSpec
- type DropKeepMutator
- type DropOpSpec
- type DuplicateMutator
- type DuplicateOpSpec
- type ExactPercentileAgg
- func (a *ExactPercentileAgg) Copy() *ExactPercentileAgg
- func (a *ExactPercentileAgg) DoFloat(vs []float64)
- func (a *ExactPercentileAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *ExactPercentileAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *ExactPercentileAgg) NewIntAgg() execute.DoIntAgg
- func (a *ExactPercentileAgg) NewStringAgg() execute.DoStringAgg
- func (a *ExactPercentileAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *ExactPercentileAgg) Type() query.DataType
- func (a *ExactPercentileAgg) ValueFloat() float64
- type ExactPercentileAggProcedureSpec
- type ExactPercentileSelectProcedureSpec
- type ExactPercentileSelectorTransformation
- func (t *ExactPercentileSelectorTransformation) Finish(id execute.DatasetID, err error)
- func (t *ExactPercentileSelectorTransformation) Process(id execute.DatasetID, tbl query.Table) error
- func (t *ExactPercentileSelectorTransformation) RetractTable(id execute.DatasetID, key query.GroupKey) error
- func (t *ExactPercentileSelectorTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error
- func (t *ExactPercentileSelectorTransformation) UpdateWatermark(id execute.DatasetID, mark execute.Time) error
- type FilterOpSpec
- type FilterProcedureSpec
- type FirstOpSpec
- type FirstProcedureSpec
- type FirstSelector
- func (s *FirstSelector) DoBool(vs []bool) []int
- func (s *FirstSelector) DoFloat(vs []float64) []int
- func (s *FirstSelector) DoInt(vs []int64) []int
- func (s *FirstSelector) DoString(vs []string) []int
- func (s *FirstSelector) DoUInt(vs []uint64) []int
- func (s *FirstSelector) NewBoolSelector() execute.DoBoolIndexSelector
- func (s *FirstSelector) NewFloatSelector() execute.DoFloatIndexSelector
- func (s *FirstSelector) NewIntSelector() execute.DoIntIndexSelector
- func (s *FirstSelector) NewStringSelector() execute.DoStringIndexSelector
- func (s *FirstSelector) NewUIntSelector() execute.DoUIntIndexSelector
- type FromCSVOpSpec
- type FromCSVProcedureSpec
- type FromOpSpec
- type FromProcedureSpec
- type GroupMode
- type GroupOpSpec
- type GroupProcedureSpec
- type HistogramOpSpec
- type HistogramProcedureSpec
- type HistogramQuantileOpSpec
- type HistogramQuantileProcedureSpec
- type IntegralOpSpec
- type IntegralProcedureSpec
- type JoinOpSpec
- type KafkaWriter
- type KeepOpSpec
- type KeysOpSpec
- type KeysPointLimitRewriteRule
- type KeysProcedureSpec
- type LastOpSpec
- type LastProcedureSpec
- type LastSelector
- func (s *LastSelector) DoBool(vs []bool, cr query.ColReader)
- func (s *LastSelector) DoFloat(vs []float64, cr query.ColReader)
- func (s *LastSelector) DoInt(vs []int64, cr query.ColReader)
- func (s *LastSelector) DoString(vs []string, cr query.ColReader)
- func (s *LastSelector) DoUInt(vs []uint64, cr query.ColReader)
- func (s *LastSelector) NewBoolSelector() execute.DoBoolRowSelector
- func (s *LastSelector) NewFloatSelector() execute.DoFloatRowSelector
- func (s *LastSelector) NewIntSelector() execute.DoIntRowSelector
- func (s *LastSelector) NewStringSelector() execute.DoStringRowSelector
- func (s *LastSelector) NewUIntSelector() execute.DoUIntRowSelector
- func (s *LastSelector) Rows() []execute.Row
- type LimitOpSpec
- type LimitProcedureSpec
- type MapOpSpec
- type MapProcedureSpec
- type MaxFloatSelector
- type MaxIntSelector
- type MaxOpSpec
- type MaxProcedureSpec
- type MaxSelector
- func (s *MaxSelector) NewBoolSelector() execute.DoBoolRowSelector
- func (s *MaxSelector) NewFloatSelector() execute.DoFloatRowSelector
- func (s *MaxSelector) NewIntSelector() execute.DoIntRowSelector
- func (s *MaxSelector) NewStringSelector() execute.DoStringRowSelector
- func (s *MaxSelector) NewUIntSelector() execute.DoUIntRowSelector
- func (s *MaxSelector) Rows() []execute.Row
- type MaxUIntSelector
- type MeanAgg
- func (a *MeanAgg) DoFloat(vs []float64)
- func (a *MeanAgg) DoInt(vs []int64)
- func (a *MeanAgg) DoUInt(vs []uint64)
- func (a *MeanAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *MeanAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *MeanAgg) NewIntAgg() execute.DoIntAgg
- func (a *MeanAgg) NewStringAgg() execute.DoStringAgg
- func (a *MeanAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *MeanAgg) Type() query.DataType
- func (a *MeanAgg) ValueFloat() float64
- type MeanOpSpec
- type MeanProcedureSpec
- type MergeJoinCache
- func (c *MergeJoinCache) DiscardTable(key query.GroupKey)
- func (c *MergeJoinCache) ExpireTable(key query.GroupKey)
- func (c *MergeJoinCache) ForEach(f func(query.GroupKey))
- func (c *MergeJoinCache) ForEachWithContext(f func(query.GroupKey, execute.Trigger, execute.TableContext))
- func (c *MergeJoinCache) SetTriggerSpec(spec query.TriggerSpec)
- func (c *MergeJoinCache) Table(key query.GroupKey) (query.Table, error)
- type MergeJoinProcedureSpec
- type MinFloatSelector
- type MinIntSelector
- type MinOpSpec
- type MinProcedureSpec
- type MinSelector
- func (s *MinSelector) NewBoolSelector() execute.DoBoolRowSelector
- func (s *MinSelector) NewFloatSelector() execute.DoFloatRowSelector
- func (s *MinSelector) NewIntSelector() execute.DoIntRowSelector
- func (s *MinSelector) NewStringSelector() execute.DoStringRowSelector
- func (s *MinSelector) NewUIntSelector() execute.DoUIntRowSelector
- func (s *MinSelector) Rows() []execute.Row
- type MinUIntSelector
- type MutationRegistrar
- type PercentileAgg
- func (a *PercentileAgg) Copy() *PercentileAgg
- func (a *PercentileAgg) DoFloat(vs []float64)
- func (a *PercentileAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *PercentileAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *PercentileAgg) NewIntAgg() execute.DoIntAgg
- func (a *PercentileAgg) NewStringAgg() execute.DoStringAgg
- func (a *PercentileAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *PercentileAgg) Type() query.DataType
- func (a *PercentileAgg) ValueFloat() float64
- type PercentileOpSpec
- type PivotOpSpec
- type PivotProcedureSpec
- type PredictLinearOpSpec
- type PredictLinearProcedureSpec
- type PredictLinearTransformation
- func (t *PredictLinearTransformation) DoFloat(ys []float64, xs []values.Time)
- func (t *PredictLinearTransformation) DoInt(ys []int64, xs []values.Time)
- func (t *PredictLinearTransformation) Finish(id execute.DatasetID, err error)
- func (t *PredictLinearTransformation) Process(id execute.DatasetID, tbl query.Table) error
- func (t *PredictLinearTransformation) RetractTable(id execute.DatasetID, key query.GroupKey) error
- func (t *PredictLinearTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error
- func (t *PredictLinearTransformation) UpdateWatermark(id execute.DatasetID, mark execute.Time) error
- type RangeOpSpec
- type RangeProcedureSpec
- func (s *RangeProcedureSpec) Copy() plan.ProcedureSpec
- func (s *RangeProcedureSpec) Kind() plan.ProcedureKind
- func (s *RangeProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
- func (s *RangeProcedureSpec) PushDownRules() []plan.PushDownRule
- func (s *RangeProcedureSpec) TimeBounds() query.Bounds
- type RenameMutator
- type RenameOpSpec
- type SampleOpSpec
- type SampleProcedureSpec
- type SampleSelector
- func (s *SampleSelector) DoBool(vs []bool) []int
- func (s *SampleSelector) DoFloat(vs []float64) []int
- func (s *SampleSelector) DoInt(vs []int64) []int
- func (s *SampleSelector) DoString(vs []string) []int
- func (s *SampleSelector) DoUInt(vs []uint64) []int
- func (s *SampleSelector) NewBoolSelector() execute.DoBoolIndexSelector
- func (s *SampleSelector) NewFloatSelector() execute.DoFloatIndexSelector
- func (s *SampleSelector) NewIntSelector() execute.DoIntIndexSelector
- func (s *SampleSelector) NewStringSelector() execute.DoStringIndexSelector
- func (s *SampleSelector) NewUIntSelector() execute.DoUIntIndexSelector
- type SchemaMutation
- type SchemaMutationProcedureSpec
- type SchemaMutator
- type SetOpSpec
- type SetProcedureSpec
- type ShiftOpSpec
- type ShiftProcedureSpec
- type SkewAgg
- func (a *SkewAgg) DoFloat(vs []float64)
- func (a *SkewAgg) DoInt(vs []int64)
- func (a *SkewAgg) DoUInt(vs []uint64)
- func (a *SkewAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *SkewAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *SkewAgg) NewIntAgg() execute.DoIntAgg
- func (a *SkewAgg) NewStringAgg() execute.DoStringAgg
- func (a *SkewAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *SkewAgg) Type() query.DataType
- func (a *SkewAgg) ValueFloat() float64
- type SkewOpSpec
- type SkewProcedureSpec
- type SortOpSpec
- type SortProcedureSpec
- type SpreadAgg
- type SpreadFloatAgg
- type SpreadIntAgg
- type SpreadOpSpec
- type SpreadProcedureSpec
- type SpreadUIntAgg
- type StateTrackingOpSpec
- type StateTrackingProcedureSpec
- type StddevAgg
- func (a *StddevAgg) DoFloat(vs []float64)
- func (a *StddevAgg) DoInt(vs []int64)
- func (a *StddevAgg) DoUInt(vs []uint64)
- func (a *StddevAgg) NewBoolAgg() execute.DoBoolAgg
- func (a *StddevAgg) NewFloatAgg() execute.DoFloatAgg
- func (a *StddevAgg) NewIntAgg() execute.DoIntAgg
- func (a *StddevAgg) NewStringAgg() execute.DoStringAgg
- func (a *StddevAgg) NewUIntAgg() execute.DoUIntAgg
- func (a *StddevAgg) Type() query.DataType
- func (a *StddevAgg) ValueFloat() float64
- type StddevOpSpec
- type StddevProcedureSpec
- type SumAgg
- type SumFloatAgg
- type SumIntAgg
- type SumOpSpec
- type SumProcedureSpec
- func (s *SumProcedureSpec) AggregateMethod() string
- func (s *SumProcedureSpec) Copy() plan.ProcedureSpec
- func (s *SumProcedureSpec) Kind() plan.ProcedureKind
- func (s *SumProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
- func (s *SumProcedureSpec) PushDownRules() []plan.PushDownRule
- func (s *SumProcedureSpec) ReAggregateSpec() plan.ProcedureSpec
- type SumUIntAgg
- type TDigestPercentileProcedureSpec
- type ToHTTPOpSpec
- type ToHTTPProcedureSpec
- type ToHTTPTransformation
- func (t *ToHTTPTransformation) Finish(id execute.DatasetID, err error)
- func (t *ToHTTPTransformation) Process(id execute.DatasetID, tbl query.Table) error
- func (t *ToHTTPTransformation) RetractTable(id execute.DatasetID, key query.GroupKey) error
- func (t *ToHTTPTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error
- func (t *ToHTTPTransformation) UpdateWatermark(id execute.DatasetID, pt execute.Time) error
- type ToKafkaOpSpec
- type ToKafkaProcedureSpec
- type ToKafkaTransformation
- func (t *ToKafkaTransformation) Finish(id execute.DatasetID, err error)
- func (t *ToKafkaTransformation) Process(id execute.DatasetID, tbl query.Table) (err error)
- func (t *ToKafkaTransformation) RetractTable(id execute.DatasetID, key query.GroupKey) error
- func (t *ToKafkaTransformation) UpdateProcessingTime(id execute.DatasetID, pt execute.Time) error
- func (t *ToKafkaTransformation) UpdateWatermark(id execute.DatasetID, pt execute.Time) error
- type UnionOpSpec
- type UnionProcedureSpec
- type UniqueOpSpec
- type UniqueProcedureSpec
- type WindowOpSpec
- type WindowProcedureSpec
- type YieldOpSpec
- type YieldProcedureSpec
Constants ¶
const ( ToHTTPKind = "toHTTP" DefaultToHTTPTimeout = 1 * time.Second )
const CountKind = "count"
const CovarianceKind = "covariance"
const CumulativeSumKind = "cumulativeSum"
const DedupKind = "dedup"
const DedupSortCol = "_time"
const DefaultUpperBoundColumnLabel = "le"
const DerivativeKind = "derivative"
const DifferenceKind = "difference"
const DistinctKind = "distinct"
const DropKind = "drop"
const DuplicateKind = "duplicate"
const ExactPercentileAggKind = "exact-percentile-aggregate"
const ExactPercentileSelectKind = "exact-percentile-selector"
const FilterKind = "filter"
const FirstKind = "first"
const FromCSVKind = "fromCSV"
const FromKind = "from"
const GroupKind = "group"
const HistogramKind = "histogram"
const HistogramQuantileKind = "histogramQuantile"
const IntegralKind = "integral"
const JoinKind = "join"
const KeepKind = "keep"
const KeysKind = "keys"
const LastKind = "last"
const LimitKind = "limit"
const MapKind = "map"
const MaxKind = "max"
const MeanKind = "mean"
const MergeJoinKind = "merge-join"
const MinKind = "min"
const PercentileKind = "percentile"
const PivotKind = "pivot"
const PredictLinearKind = "predictLinear"
const RangeKind = "range"
const RenameKind = "rename"
const SampleKind = "sample"
const SchemaMutationKind = "SchemaMutation"
The base kind for SchemaMutations
const SetKind = "set"
const ShiftKind = "shift"
const SkewKind = "skew"
const SortKind = "sort"
const SpreadKind = "spread"
SpreadKind is the registration name for Flux, query, plan, and execution.
const StateTrackingKind = "stateTracking"
const StddevKind = "stddev"
const SumKind = "sum"
const (
// ToKafkaKind is the Kind for the ToKafka Flux function
ToKafkaKind = "toKafka"
)
const UnionKind = "union"
const UniqueKind = "unique"
const WindowKind = "window"
const YieldKind = "yield"
Variables ¶
var DefaultKafkaWriterFactory = func(conf kafka.WriterConfig) KafkaWriter { return kafka.NewWriter(conf) }
DefaultKafkaWriterFactory is a terrible name for a way to make a kafkaWriter that is injectable for testing
var DefaultToHTTPUserAgent = "fluxd/dev"
DefaultToHTTPUserAgent is the default user agent used by ToHttp
var Registrars = []MutationRegistrar{ { Kind: RenameKind, Args: map[string]semantic.Type{ "columns": semantic.Object, "fn": semantic.Function, }, Create: createRenameOpSpec, New: newRenameOp, }, { Kind: DropKind, Args: map[string]semantic.Type{ "columns": semantic.NewArrayType(semantic.String), "fn": semantic.Function, }, Create: createDropOpSpec, New: newDropOp, }, { Kind: KeepKind, Args: map[string]semantic.Type{ "columns": semantic.NewArrayType(semantic.String), "fn": semantic.Function, }, Create: createKeepOpSpec, New: newKeepOp, }, { Kind: DuplicateKind, Args: map[string]semantic.Type{ "column": semantic.String, "as": semantic.String, }, Create: createDuplicateOpSpec, New: newDuplicateOp, }, }
A list of all MutationRegistrars to register. To register a new mutation, add an entry to this list.
var SchemaMutationOps = []query.OperationKind{}
A list of all operations which should map to the SchemaMutationProcedure Added to dynamically upon calls to `Register()`
var ToHTTPSignature = query.DefaultFunctionSignature()
var ToKafkaSignature = query.DefaultFunctionSignature()
Functions ¶
func InjectFromDependencies ¶
func InjectFromDependencies(depsMap execute.Dependencies, deps storage.Dependencies) error
func NewCumulativeSumTransformation ¶
func NewCumulativeSumTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *CumulativeSumProcedureSpec) *cumulativeSumTransformation
func NewDedupTransformation ¶
func NewDedupTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DedupProcedureSpec) *dedupTransformation
func NewDerivativeTransformation ¶
func NewDerivativeTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DerivativeProcedureSpec) *derivativeTransformation
func NewDifferenceTransformation ¶
func NewDifferenceTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DifferenceProcedureSpec) *differenceTransformation
func NewDistinctTransformation ¶
func NewDistinctTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *DistinctProcedureSpec) *distinctTransformation
func NewFilterTransformation ¶
func NewFilterTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *FilterProcedureSpec) (*filterTransformation, error)
func NewGroupTransformation ¶
func NewGroupTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *GroupProcedureSpec) *groupTransformation
func NewHistogramTransformation ¶
func NewHistogramTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *HistogramProcedureSpec) *histogramTransformation
func NewHistorgramQuantileTransformation ¶
func NewHistorgramQuantileTransformation( d execute.Dataset, cache execute.TableBuilderCache, spec *HistogramQuantileProcedureSpec, ) execute.Transformation
func NewIntegralTransformation ¶
func NewIntegralTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *IntegralProcedureSpec) *integralTransformation
func NewKeysTransformation ¶
func NewKeysTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *KeysProcedureSpec) *keysTransformation
func NewLimitTransformation ¶
func NewLimitTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *LimitProcedureSpec) *limitTransformation
func NewMapTransformation ¶
func NewMapTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *MapProcedureSpec) (*mapTransformation, error)
func NewMergeJoinTransformation ¶
func NewMergeJoinTransformation(d execute.Dataset, cache *MergeJoinCache, spec *MergeJoinProcedureSpec, parents []execute.DatasetID, tableNames map[execute.DatasetID]string) *mergeJoinTransformation
func NewPivotTransformation ¶
func NewPivotTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *PivotProcedureSpec) *pivotTransformation
func NewRangeTransformation ¶
func NewRangeTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *RangeProcedureSpec, absolute execute.Bounds) (*rangeTransformation, error)
func NewSchemaMutationTransformation ¶
func NewSchemaMutationTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec plan.ProcedureSpec) (*schemaMutationTransformation, error)
func NewSetTransformation ¶
func NewSetTransformation( d execute.Dataset, cache execute.TableBuilderCache, spec *SetProcedureSpec, ) execute.Transformation
func NewShiftTransformation ¶
func NewShiftTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ShiftProcedureSpec) *shiftTransformation
func NewSortTransformation ¶
func NewSortTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *SortProcedureSpec) *sortTransformation
func NewStateTrackingTransformation ¶
func NewStateTrackingTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *StateTrackingProcedureSpec) (*stateTrackingTransformation, error)
func NewUniqueTransformation ¶
func NewUniqueTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *UniqueProcedureSpec) *uniqueTransformation
func SystemTime ¶
SystemTime return a function value that when called will give the current system time
Types ¶
type AggregateGroupRewriteRule ¶
type AggregateGroupRewriteRule struct {
}
func (AggregateGroupRewriteRule) Rewrite ¶
func (r AggregateGroupRewriteRule) Rewrite(pr *plan.Procedure, planner plan.PlanRewriter) error
func (AggregateGroupRewriteRule) Root ¶
func (r AggregateGroupRewriteRule) Root() plan.ProcedureKind
type BuilderContext ¶
func NewBuilderContext ¶
func NewBuilderContext(tbl query.Table) *BuilderContext
func (*BuilderContext) ColMap ¶
func (b *BuilderContext) ColMap() []int
func (*BuilderContext) Cols ¶
func (b *BuilderContext) Cols() []query.ColMeta
func (*BuilderContext) Key ¶
func (b *BuilderContext) Key() query.GroupKey
type CSVSource ¶
type CSVSource struct {
// contains filtered or unexported fields
}
func (*CSVSource) AddTransformation ¶
func (c *CSVSource) AddTransformation(t execute.Transformation)
type CountAgg ¶
type CountAgg struct {
// contains filtered or unexported fields
}
func (*CountAgg) NewBoolAgg ¶
func (*CountAgg) NewFloatAgg ¶
func (a *CountAgg) NewFloatAgg() execute.DoFloatAgg
func (*CountAgg) NewStringAgg ¶
func (a *CountAgg) NewStringAgg() execute.DoStringAgg
func (*CountAgg) NewUIntAgg ¶
type CountOpSpec ¶
type CountOpSpec struct {
execute.AggregateConfig
}
func (*CountOpSpec) Kind ¶
func (s *CountOpSpec) Kind() query.OperationKind
type CountProcedureSpec ¶
type CountProcedureSpec struct {
execute.AggregateConfig
}
func (*CountProcedureSpec) AggregateMethod ¶
func (s *CountProcedureSpec) AggregateMethod() string
func (*CountProcedureSpec) Copy ¶
func (s *CountProcedureSpec) Copy() plan.ProcedureSpec
func (*CountProcedureSpec) Kind ¶
func (s *CountProcedureSpec) Kind() plan.ProcedureKind
func (*CountProcedureSpec) PushDown ¶
func (s *CountProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*CountProcedureSpec) PushDownRules ¶
func (s *CountProcedureSpec) PushDownRules() []plan.PushDownRule
func (*CountProcedureSpec) ReAggregateSpec ¶
func (s *CountProcedureSpec) ReAggregateSpec() plan.ProcedureSpec
type CovarianceOpSpec ¶
type CovarianceOpSpec struct {
PearsonCorrelation bool `json:"pearsonr"`
ValueDst string `json:"valueDst"`
execute.AggregateConfig
}
func (*CovarianceOpSpec) Kind ¶
func (s *CovarianceOpSpec) Kind() query.OperationKind
type CovarianceProcedureSpec ¶
type CovarianceProcedureSpec struct {
PearsonCorrelation bool
ValueLabel string
execute.AggregateConfig
}
func (*CovarianceProcedureSpec) Copy ¶
func (s *CovarianceProcedureSpec) Copy() plan.ProcedureSpec
func (*CovarianceProcedureSpec) Kind ¶
func (s *CovarianceProcedureSpec) Kind() plan.ProcedureKind
type CovarianceTransformation ¶
type CovarianceTransformation struct {
// contains filtered or unexported fields
}
func NewCovarianceTransformation ¶
func NewCovarianceTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *CovarianceProcedureSpec) *CovarianceTransformation
func (*CovarianceTransformation) DoFloat ¶
func (t *CovarianceTransformation) DoFloat(xs, ys []float64)
func (*CovarianceTransformation) Finish ¶
func (t *CovarianceTransformation) Finish(id execute.DatasetID, err error)
func (*CovarianceTransformation) RetractTable ¶
func (*CovarianceTransformation) UpdateProcessingTime ¶
func (*CovarianceTransformation) UpdateWatermark ¶
type CumulativeSumOpSpec ¶
type CumulativeSumOpSpec struct {
Columns []string `json:"columns"`
}
func (*CumulativeSumOpSpec) Kind ¶
func (s *CumulativeSumOpSpec) Kind() query.OperationKind
type CumulativeSumProcedureSpec ¶
type CumulativeSumProcedureSpec struct {
Columns []string
}
func (*CumulativeSumProcedureSpec) Copy ¶
func (s *CumulativeSumProcedureSpec) Copy() plan.ProcedureSpec
func (*CumulativeSumProcedureSpec) Kind ¶
func (s *CumulativeSumProcedureSpec) Kind() plan.ProcedureKind
type DedupOpSpec ¶
type DedupOpSpec struct {
}
func (*DedupOpSpec) Kind ¶
func (s *DedupOpSpec) Kind() query.OperationKind
type DedupProcedureSpec ¶
type DedupProcedureSpec struct {
Column string
}
func (*DedupProcedureSpec) Copy ¶
func (s *DedupProcedureSpec) Copy() plan.ProcedureSpec
func (*DedupProcedureSpec) Kind ¶
func (s *DedupProcedureSpec) Kind() plan.ProcedureKind
type DerivativeOpSpec ¶
type DerivativeOpSpec struct {
Unit query.Duration `json:"unit"`
NonNegative bool `json:"nonNegative"`
Columns []string `json:"columns"`
TimeSrc string `json:"timeSrc"`
}
func (*DerivativeOpSpec) Kind ¶
func (s *DerivativeOpSpec) Kind() query.OperationKind
type DerivativeProcedureSpec ¶
type DerivativeProcedureSpec struct {
Unit query.Duration `json:"unit"`
NonNegative bool `json:"non_negative"`
Columns []string `json:"columns"`
TimeCol string `json:"time_col"`
}
func (*DerivativeProcedureSpec) Copy ¶
func (s *DerivativeProcedureSpec) Copy() plan.ProcedureSpec
func (*DerivativeProcedureSpec) Kind ¶
func (s *DerivativeProcedureSpec) Kind() plan.ProcedureKind
type DifferenceOpSpec ¶
type DifferenceOpSpec struct {
NonNegative bool `json:"nonNegative"`
Columns []string `json:"columns"`
}
func (*DifferenceOpSpec) Kind ¶
func (s *DifferenceOpSpec) Kind() query.OperationKind
type DifferenceProcedureSpec ¶
type DifferenceProcedureSpec struct {
NonNegative bool `json:"non_negative"`
Columns []string `json:"columns"`
}
func (*DifferenceProcedureSpec) Copy ¶
func (s *DifferenceProcedureSpec) Copy() plan.ProcedureSpec
func (*DifferenceProcedureSpec) Kind ¶
func (s *DifferenceProcedureSpec) Kind() plan.ProcedureKind
type DistinctOpSpec ¶
type DistinctOpSpec struct {
Column string `json:"column"`
}
func (*DistinctOpSpec) Kind ¶
func (s *DistinctOpSpec) Kind() query.OperationKind
type DistinctPointLimitRewriteRule ¶
type DistinctPointLimitRewriteRule struct {
}
func (DistinctPointLimitRewriteRule) Rewrite ¶
func (r DistinctPointLimitRewriteRule) Rewrite(pr *plan.Procedure, planner plan.PlanRewriter) error
func (DistinctPointLimitRewriteRule) Root ¶
func (r DistinctPointLimitRewriteRule) Root() plan.ProcedureKind
type DistinctProcedureSpec ¶
type DistinctProcedureSpec struct {
Column string
}
func (*DistinctProcedureSpec) Copy ¶
func (s *DistinctProcedureSpec) Copy() plan.ProcedureSpec
func (*DistinctProcedureSpec) Kind ¶
func (s *DistinctProcedureSpec) Kind() plan.ProcedureKind
type DropKeepMutator ¶
type DropKeepMutator struct {
KeepCols map[string]bool
DropCols map[string]bool
Predicate compiler.Func
FlipPredicate bool
ParamName string
Scope map[string]values.Value
}
func NewDropKeepMutator ¶
func NewDropKeepMutator(qs query.OperationSpec) (*DropKeepMutator, error)
func (*DropKeepMutator) Mutate ¶
func (m *DropKeepMutator) Mutate(ctx *BuilderContext) error
type DropOpSpec ¶
type DropOpSpec struct {
Cols []string `json:"columns"`
Predicate *semantic.FunctionExpression `json:"fn"`
}
func (*DropOpSpec) Copy ¶
func (s *DropOpSpec) Copy() SchemaMutation
func (*DropOpSpec) Kind ¶
func (s *DropOpSpec) Kind() query.OperationKind
func (*DropOpSpec) Mutator ¶
func (s *DropOpSpec) Mutator() (SchemaMutator, error)
type DuplicateMutator ¶
func NewDuplicateMutator ¶
func NewDuplicateMutator(qs query.OperationSpec) (*DuplicateMutator, error)
func (*DuplicateMutator) Mutate ¶
func (m *DuplicateMutator) Mutate(ctx *BuilderContext) error
type DuplicateOpSpec ¶
func (*DuplicateOpSpec) Copy ¶
func (s *DuplicateOpSpec) Copy() SchemaMutation
func (*DuplicateOpSpec) Kind ¶
func (s *DuplicateOpSpec) Kind() query.OperationKind
func (*DuplicateOpSpec) Mutator ¶
func (s *DuplicateOpSpec) Mutator() (SchemaMutator, error)
type ExactPercentileAgg ¶
type ExactPercentileAgg struct {
Quantile float64
// contains filtered or unexported fields
}
func (*ExactPercentileAgg) Copy ¶
func (a *ExactPercentileAgg) Copy() *ExactPercentileAgg
func (*ExactPercentileAgg) DoFloat ¶
func (a *ExactPercentileAgg) DoFloat(vs []float64)
func (*ExactPercentileAgg) NewBoolAgg ¶
func (a *ExactPercentileAgg) NewBoolAgg() execute.DoBoolAgg
func (*ExactPercentileAgg) NewFloatAgg ¶
func (a *ExactPercentileAgg) NewFloatAgg() execute.DoFloatAgg
func (*ExactPercentileAgg) NewIntAgg ¶
func (a *ExactPercentileAgg) NewIntAgg() execute.DoIntAgg
func (*ExactPercentileAgg) NewStringAgg ¶
func (a *ExactPercentileAgg) NewStringAgg() execute.DoStringAgg
func (*ExactPercentileAgg) NewUIntAgg ¶
func (a *ExactPercentileAgg) NewUIntAgg() execute.DoUIntAgg
func (*ExactPercentileAgg) Type ¶
func (a *ExactPercentileAgg) Type() query.DataType
func (*ExactPercentileAgg) ValueFloat ¶
func (a *ExactPercentileAgg) ValueFloat() float64
type ExactPercentileAggProcedureSpec ¶
type ExactPercentileAggProcedureSpec struct {
Percentile float64 `json:"percentile"`
execute.AggregateConfig
}
func (*ExactPercentileAggProcedureSpec) Copy ¶
func (s *ExactPercentileAggProcedureSpec) Copy() plan.ProcedureSpec
func (*ExactPercentileAggProcedureSpec) Kind ¶
func (s *ExactPercentileAggProcedureSpec) Kind() plan.ProcedureKind
type ExactPercentileSelectProcedureSpec ¶
type ExactPercentileSelectProcedureSpec struct {
Percentile float64 `json:"percentile"`
execute.SelectorConfig
}
func (*ExactPercentileSelectProcedureSpec) Copy ¶
func (s *ExactPercentileSelectProcedureSpec) Copy() plan.ProcedureSpec
func (*ExactPercentileSelectProcedureSpec) Kind ¶
func (s *ExactPercentileSelectProcedureSpec) Kind() plan.ProcedureKind
type ExactPercentileSelectorTransformation ¶
type ExactPercentileSelectorTransformation struct {
// contains filtered or unexported fields
}
func NewExactPercentileSelectorTransformation ¶
func NewExactPercentileSelectorTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ExactPercentileSelectProcedureSpec, a *execute.Allocator) *ExactPercentileSelectorTransformation
func (*ExactPercentileSelectorTransformation) Finish ¶
func (t *ExactPercentileSelectorTransformation) Finish(id execute.DatasetID, err error)
func (*ExactPercentileSelectorTransformation) RetractTable ¶
func (*ExactPercentileSelectorTransformation) UpdateProcessingTime ¶
func (*ExactPercentileSelectorTransformation) UpdateWatermark ¶
type FilterOpSpec ¶
type FilterOpSpec struct {
Fn *semantic.FunctionExpression `json:"fn"`
}
func (*FilterOpSpec) Kind ¶
func (s *FilterOpSpec) Kind() query.OperationKind
type FilterProcedureSpec ¶
type FilterProcedureSpec struct {
Fn *semantic.FunctionExpression
}
func (*FilterProcedureSpec) Copy ¶
func (s *FilterProcedureSpec) Copy() plan.ProcedureSpec
func (*FilterProcedureSpec) Kind ¶
func (s *FilterProcedureSpec) Kind() plan.ProcedureKind
func (*FilterProcedureSpec) PushDown ¶
func (s *FilterProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*FilterProcedureSpec) PushDownRules ¶
func (s *FilterProcedureSpec) PushDownRules() []plan.PushDownRule
type FirstOpSpec ¶
type FirstOpSpec struct {
execute.SelectorConfig
}
func (*FirstOpSpec) Kind ¶
func (s *FirstOpSpec) Kind() query.OperationKind
type FirstProcedureSpec ¶
type FirstProcedureSpec struct {
execute.SelectorConfig
}
func (*FirstProcedureSpec) Copy ¶
func (s *FirstProcedureSpec) Copy() plan.ProcedureSpec
func (*FirstProcedureSpec) Kind ¶
func (s *FirstProcedureSpec) Kind() plan.ProcedureKind
func (*FirstProcedureSpec) PushDown ¶
func (s *FirstProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*FirstProcedureSpec) PushDownRules ¶
func (s *FirstProcedureSpec) PushDownRules() []plan.PushDownRule
type FirstSelector ¶
type FirstSelector struct {
// contains filtered or unexported fields
}
func (*FirstSelector) DoBool ¶
func (s *FirstSelector) DoBool(vs []bool) []int
func (*FirstSelector) DoFloat ¶
func (s *FirstSelector) DoFloat(vs []float64) []int
func (*FirstSelector) DoInt ¶
func (s *FirstSelector) DoInt(vs []int64) []int
func (*FirstSelector) DoString ¶
func (s *FirstSelector) DoString(vs []string) []int
func (*FirstSelector) DoUInt ¶
func (s *FirstSelector) DoUInt(vs []uint64) []int
func (*FirstSelector) NewBoolSelector ¶
func (s *FirstSelector) NewBoolSelector() execute.DoBoolIndexSelector
func (*FirstSelector) NewFloatSelector ¶
func (s *FirstSelector) NewFloatSelector() execute.DoFloatIndexSelector
func (*FirstSelector) NewIntSelector ¶
func (s *FirstSelector) NewIntSelector() execute.DoIntIndexSelector
func (*FirstSelector) NewStringSelector ¶
func (s *FirstSelector) NewStringSelector() execute.DoStringIndexSelector
func (*FirstSelector) NewUIntSelector ¶
func (s *FirstSelector) NewUIntSelector() execute.DoUIntIndexSelector
type FromCSVOpSpec ¶
func (*FromCSVOpSpec) Kind ¶
func (s *FromCSVOpSpec) Kind() query.OperationKind
type FromCSVProcedureSpec ¶
func (*FromCSVProcedureSpec) Copy ¶
func (s *FromCSVProcedureSpec) Copy() plan.ProcedureSpec
func (*FromCSVProcedureSpec) Kind ¶
func (s *FromCSVProcedureSpec) Kind() plan.ProcedureKind
type FromOpSpec ¶
type FromOpSpec struct {
Bucket string `json:"bucket,omitempty"`
BucketID platform.ID `json:"bucketID,omitempty"`
}
func (*FromOpSpec) BucketsAccessed ¶
func (s *FromOpSpec) BucketsAccessed() (readBuckets, writeBuckets []platform.BucketFilter)
func (*FromOpSpec) Kind ¶
func (s *FromOpSpec) Kind() query.OperationKind
type FromProcedureSpec ¶
type FromProcedureSpec struct {
Bucket string
BucketID platform.ID
BoundsSet bool
Bounds query.Bounds
FilterSet bool
Filter *semantic.FunctionExpression
DescendingSet bool
Descending bool
LimitSet bool
PointsLimit int64
SeriesLimit int64
SeriesOffset int64
WindowSet bool
Window plan.WindowSpec
GroupingSet bool
OrderByTime bool
GroupMode GroupMode
GroupKeys []string
AggregateSet bool
AggregateMethod string
}
func (*FromProcedureSpec) Copy ¶
func (s *FromProcedureSpec) Copy() plan.ProcedureSpec
func (*FromProcedureSpec) Kind ¶
func (s *FromProcedureSpec) Kind() plan.ProcedureKind
func (*FromProcedureSpec) TimeBounds ¶
func (s *FromProcedureSpec) TimeBounds() query.Bounds
type GroupMode ¶
type GroupMode int
const ( // GroupModeDefault will use the default grouping of GroupModeAll. GroupModeDefault GroupMode = 0 // GroupModeNone merges all series into a single group. GroupModeNone GroupMode = 1 << iota // GroupModeAll produces a separate table for each series. GroupModeAll // GroupModeBy produces a table for each unique value of the specified GroupKeys. GroupModeBy // GroupModeExcept produces a table for the unique values of all keys, except those specified by GroupKeys. GroupModeExcept )
type GroupOpSpec ¶
type GroupOpSpec struct {
By []string `json:"by"`
Except []string `json:"except"`
All bool `json:"all"`
None bool `json:"none"`
}
func (*GroupOpSpec) Kind ¶
func (s *GroupOpSpec) Kind() query.OperationKind
type GroupProcedureSpec ¶
func (*GroupProcedureSpec) Copy ¶
func (s *GroupProcedureSpec) Copy() plan.ProcedureSpec
func (*GroupProcedureSpec) Kind ¶
func (s *GroupProcedureSpec) Kind() plan.ProcedureKind
func (*GroupProcedureSpec) PushDown ¶
func (s *GroupProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*GroupProcedureSpec) PushDownRules ¶
func (s *GroupProcedureSpec) PushDownRules() []plan.PushDownRule
type HistogramOpSpec ¶
type HistogramOpSpec struct {
Column string `json:"column"`
UpperBoundColumn string `json:"upperBoundColumn"`
CountColumn string `json:"countColumn"`
Buckets []float64 `json:"buckets"`
Normalize bool `json:"normalize"`
}
func (*HistogramOpSpec) Kind ¶
func (s *HistogramOpSpec) Kind() query.OperationKind
type HistogramProcedureSpec ¶
type HistogramProcedureSpec struct {
HistogramOpSpec
}
func (*HistogramProcedureSpec) Copy ¶
func (s *HistogramProcedureSpec) Copy() plan.ProcedureSpec
func (*HistogramProcedureSpec) Kind ¶
func (s *HistogramProcedureSpec) Kind() plan.ProcedureKind
type HistogramQuantileOpSpec ¶
type HistogramQuantileOpSpec struct {
Quantile float64 `json:"quantile"`
CountColumn string `json:"countColumn"`
UpperBoundColumn string `json:"upperBoundColumn"`
ValueColumn string `json:"valueColumn"`
MinValue float64 `json:"minValue"`
}
func (*HistogramQuantileOpSpec) Kind ¶
func (s *HistogramQuantileOpSpec) Kind() query.OperationKind
type HistogramQuantileProcedureSpec ¶
type HistogramQuantileProcedureSpec struct {
Quantile float64 `json:"quantile"`
CountColumn string `json:"countColumn"`
UpperBoundColumn string `json:"upperBoundColumn"`
ValueColumn string `json:"valueColumn"`
MinValue float64 `json:"minValue"`
}
func (*HistogramQuantileProcedureSpec) Copy ¶
func (s *HistogramQuantileProcedureSpec) Copy() plan.ProcedureSpec
func (*HistogramQuantileProcedureSpec) Kind ¶
func (s *HistogramQuantileProcedureSpec) Kind() plan.ProcedureKind
type IntegralOpSpec ¶
type IntegralOpSpec struct {
Unit query.Duration `json:"unit"`
execute.AggregateConfig
}
func (*IntegralOpSpec) Kind ¶
func (s *IntegralOpSpec) Kind() query.OperationKind
type IntegralProcedureSpec ¶
type IntegralProcedureSpec struct {
Unit query.Duration `json:"unit"`
execute.AggregateConfig
}
func (*IntegralProcedureSpec) Copy ¶
func (s *IntegralProcedureSpec) Copy() plan.ProcedureSpec
func (*IntegralProcedureSpec) Kind ¶
func (s *IntegralProcedureSpec) Kind() plan.ProcedureKind
type JoinOpSpec ¶
type JoinOpSpec struct {
// On is a list of tags on which to join.
On []string `json:"on"`
// TableNames are the names to give to each parent when populating the parameter for the function.
// The first parent is referenced by the first name and so forth.
// TODO(nathanielc): Change this to a map of parent operation IDs to names.
// Then make it possible for the transformation to map operation IDs to parent IDs.
TableNames map[query.OperationID]string `json:"tableNames"`
// Method is a the type of join to perform
Method string `json:"method"`
// contains filtered or unexported fields
}
func (*JoinOpSpec) IDer ¶
func (t *JoinOpSpec) IDer(ider query.IDer)
func (*JoinOpSpec) Kind ¶
func (s *JoinOpSpec) Kind() query.OperationKind
type KafkaWriter ¶
KafkaWriter is an interface for what we need fromDefaultKafkaWriterFactory
type KeepOpSpec ¶
type KeepOpSpec struct {
Cols []string `json:"columns"`
Predicate *semantic.FunctionExpression `json:"fn"`
}
func (*KeepOpSpec) Copy ¶
func (s *KeepOpSpec) Copy() SchemaMutation
func (*KeepOpSpec) Kind ¶
func (s *KeepOpSpec) Kind() query.OperationKind
func (*KeepOpSpec) Mutator ¶
func (s *KeepOpSpec) Mutator() (SchemaMutator, error)
type KeysOpSpec ¶
type KeysOpSpec struct {
Except []string `json:"except"`
}
func (*KeysOpSpec) Kind ¶
func (s *KeysOpSpec) Kind() query.OperationKind
type KeysPointLimitRewriteRule ¶
type KeysPointLimitRewriteRule struct {
}
func (KeysPointLimitRewriteRule) Rewrite ¶
func (r KeysPointLimitRewriteRule) Rewrite(pr *plan.Procedure, planner plan.PlanRewriter) error
func (KeysPointLimitRewriteRule) Root ¶
func (r KeysPointLimitRewriteRule) Root() plan.ProcedureKind
type KeysProcedureSpec ¶
type KeysProcedureSpec struct {
Except []string
}
func (*KeysProcedureSpec) Copy ¶
func (s *KeysProcedureSpec) Copy() plan.ProcedureSpec
func (*KeysProcedureSpec) Kind ¶
func (s *KeysProcedureSpec) Kind() plan.ProcedureKind
type LastOpSpec ¶
type LastOpSpec struct {
execute.SelectorConfig
}
func (*LastOpSpec) Kind ¶
func (s *LastOpSpec) Kind() query.OperationKind
type LastProcedureSpec ¶
type LastProcedureSpec struct {
execute.SelectorConfig
}
func (*LastProcedureSpec) Copy ¶
func (s *LastProcedureSpec) Copy() plan.ProcedureSpec
func (*LastProcedureSpec) Kind ¶
func (s *LastProcedureSpec) Kind() plan.ProcedureKind
func (*LastProcedureSpec) PushDown ¶
func (s *LastProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*LastProcedureSpec) PushDownRules ¶
func (s *LastProcedureSpec) PushDownRules() []plan.PushDownRule
type LastSelector ¶
type LastSelector struct {
// contains filtered or unexported fields
}
func (*LastSelector) NewBoolSelector ¶
func (s *LastSelector) NewBoolSelector() execute.DoBoolRowSelector
func (*LastSelector) NewFloatSelector ¶
func (s *LastSelector) NewFloatSelector() execute.DoFloatRowSelector
func (*LastSelector) NewIntSelector ¶
func (s *LastSelector) NewIntSelector() execute.DoIntRowSelector
func (*LastSelector) NewStringSelector ¶
func (s *LastSelector) NewStringSelector() execute.DoStringRowSelector
func (*LastSelector) NewUIntSelector ¶
func (s *LastSelector) NewUIntSelector() execute.DoUIntRowSelector
func (*LastSelector) Rows ¶
func (s *LastSelector) Rows() []execute.Row
type LimitOpSpec ¶
LimitOpSpec limits the number of rows returned per table. Currently offset is not supported.
func (*LimitOpSpec) Kind ¶
func (s *LimitOpSpec) Kind() query.OperationKind
type LimitProcedureSpec ¶
func (*LimitProcedureSpec) Copy ¶
func (s *LimitProcedureSpec) Copy() plan.ProcedureSpec
func (*LimitProcedureSpec) Kind ¶
func (s *LimitProcedureSpec) Kind() plan.ProcedureKind
func (*LimitProcedureSpec) PushDown ¶
func (s *LimitProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*LimitProcedureSpec) PushDownRules ¶
func (s *LimitProcedureSpec) PushDownRules() []plan.PushDownRule
type MapOpSpec ¶
type MapOpSpec struct {
Fn *semantic.FunctionExpression `json:"fn"`
MergeKey bool `json:"mergeKey"`
}
func (*MapOpSpec) Kind ¶
func (s *MapOpSpec) Kind() query.OperationKind
type MapProcedureSpec ¶
type MapProcedureSpec struct {
Fn *semantic.FunctionExpression
MergeKey bool
}
func (*MapProcedureSpec) Copy ¶
func (s *MapProcedureSpec) Copy() plan.ProcedureSpec
func (*MapProcedureSpec) Kind ¶
func (s *MapProcedureSpec) Kind() plan.ProcedureKind
type MaxFloatSelector ¶
type MaxFloatSelector struct {
MaxSelector
// contains filtered or unexported fields
}
type MaxIntSelector ¶
type MaxIntSelector struct {
MaxSelector
// contains filtered or unexported fields
}
type MaxOpSpec ¶
type MaxOpSpec struct {
execute.SelectorConfig
}
func (*MaxOpSpec) Kind ¶
func (s *MaxOpSpec) Kind() query.OperationKind
type MaxProcedureSpec ¶
type MaxProcedureSpec struct {
execute.SelectorConfig
}
func (*MaxProcedureSpec) Copy ¶
func (s *MaxProcedureSpec) Copy() plan.ProcedureSpec
func (*MaxProcedureSpec) Kind ¶
func (s *MaxProcedureSpec) Kind() plan.ProcedureKind
type MaxSelector ¶
type MaxSelector struct {
// contains filtered or unexported fields
}
func (*MaxSelector) NewBoolSelector ¶
func (s *MaxSelector) NewBoolSelector() execute.DoBoolRowSelector
func (*MaxSelector) NewFloatSelector ¶
func (s *MaxSelector) NewFloatSelector() execute.DoFloatRowSelector
func (*MaxSelector) NewIntSelector ¶
func (s *MaxSelector) NewIntSelector() execute.DoIntRowSelector
func (*MaxSelector) NewStringSelector ¶
func (s *MaxSelector) NewStringSelector() execute.DoStringRowSelector
func (*MaxSelector) NewUIntSelector ¶
func (s *MaxSelector) NewUIntSelector() execute.DoUIntRowSelector
func (*MaxSelector) Rows ¶
func (s *MaxSelector) Rows() []execute.Row
type MaxUIntSelector ¶
type MaxUIntSelector struct {
MaxSelector
// contains filtered or unexported fields
}
type MeanAgg ¶
type MeanAgg struct {
// contains filtered or unexported fields
}
func (*MeanAgg) NewBoolAgg ¶
func (*MeanAgg) NewFloatAgg ¶
func (a *MeanAgg) NewFloatAgg() execute.DoFloatAgg
func (*MeanAgg) NewStringAgg ¶
func (a *MeanAgg) NewStringAgg() execute.DoStringAgg
func (*MeanAgg) NewUIntAgg ¶
func (*MeanAgg) ValueFloat ¶
type MeanOpSpec ¶
type MeanOpSpec struct {
execute.AggregateConfig
}
func (*MeanOpSpec) Kind ¶
func (s *MeanOpSpec) Kind() query.OperationKind
type MeanProcedureSpec ¶
type MeanProcedureSpec struct {
execute.AggregateConfig
}
func (*MeanProcedureSpec) Copy ¶
func (s *MeanProcedureSpec) Copy() plan.ProcedureSpec
func (*MeanProcedureSpec) Kind ¶
func (s *MeanProcedureSpec) Kind() plan.ProcedureKind
type MergeJoinCache ¶
type MergeJoinCache struct {
// contains filtered or unexported fields
}
MergeJoinCache implements execute.DataCache This is where the all the tables to be joined are stored.
buffers: Buffers to hold the tables for each incoming stream.
postJoinKeys: The post-join group keys for all joined tables.
These group keys are constructed and stored as soon as a table is consumed by the join operator, but prior to actually joining the data.
reverseLookup: Each output group key that is stored is mapped to its
corresponding pre-join group keys. These pre-join group keys are then used to retrieve their correspoinding tables from the buffers.
tables: All output tables are materialized and stored in this
map before being sent to downstream operators.
func NewMergeJoinCache ¶
func NewMergeJoinCache(alloc *execute.Allocator, datasetIDs []execute.DatasetID, tableNames map[execute.DatasetID]string, key []string) *MergeJoinCache
NewMergeJoinCache constructs a new instance of a MergeJoinCache
func (*MergeJoinCache) DiscardTable ¶
func (c *MergeJoinCache) DiscardTable(key query.GroupKey)
DiscardTable removes a table from the output buffer
func (*MergeJoinCache) ExpireTable ¶
func (c *MergeJoinCache) ExpireTable(key query.GroupKey)
ExpireTable removes the a key from the set of postJoinKeys. ExpireTable will be called after the table associated with key has already been materialized. As a result, it cannot not be materialized again. Each buffer is cleared of any stale data that arises as a result of this process.
func (*MergeJoinCache) ForEach ¶
func (c *MergeJoinCache) ForEach(f func(query.GroupKey))
ForEach iterates over each table in the output stream
func (*MergeJoinCache) ForEachWithContext ¶
func (c *MergeJoinCache) ForEachWithContext(f func(query.GroupKey, execute.Trigger, execute.TableContext))
ForEachWithContext iterates over each table in the output stream
func (*MergeJoinCache) SetTriggerSpec ¶
func (c *MergeJoinCache) SetTriggerSpec(spec query.TriggerSpec)
SetTriggerSpec sets the trigger rule for this cache
type MergeJoinProcedureSpec ¶
type MergeJoinProcedureSpec struct {
On []string `json:"keys"`
TableNames map[plan.ProcedureID]string `json:"table_names"`
}
func (*MergeJoinProcedureSpec) Copy ¶
func (s *MergeJoinProcedureSpec) Copy() plan.ProcedureSpec
func (*MergeJoinProcedureSpec) Kind ¶
func (s *MergeJoinProcedureSpec) Kind() plan.ProcedureKind
func (*MergeJoinProcedureSpec) ParentChanged ¶
func (s *MergeJoinProcedureSpec) ParentChanged(old, new plan.ProcedureID)
type MinFloatSelector ¶
type MinFloatSelector struct {
MinSelector
// contains filtered or unexported fields
}
type MinIntSelector ¶
type MinIntSelector struct {
MinSelector
// contains filtered or unexported fields
}
type MinOpSpec ¶
type MinOpSpec struct {
execute.SelectorConfig
}
func (*MinOpSpec) Kind ¶
func (s *MinOpSpec) Kind() query.OperationKind
type MinProcedureSpec ¶
type MinProcedureSpec struct {
execute.SelectorConfig
}
func (*MinProcedureSpec) Copy ¶
func (s *MinProcedureSpec) Copy() plan.ProcedureSpec
func (*MinProcedureSpec) Kind ¶
func (s *MinProcedureSpec) Kind() plan.ProcedureKind
type MinSelector ¶
type MinSelector struct {
// contains filtered or unexported fields
}
func (*MinSelector) NewBoolSelector ¶
func (s *MinSelector) NewBoolSelector() execute.DoBoolRowSelector
func (*MinSelector) NewFloatSelector ¶
func (s *MinSelector) NewFloatSelector() execute.DoFloatRowSelector
func (*MinSelector) NewIntSelector ¶
func (s *MinSelector) NewIntSelector() execute.DoIntRowSelector
func (*MinSelector) NewStringSelector ¶
func (s *MinSelector) NewStringSelector() execute.DoStringRowSelector
func (*MinSelector) NewUIntSelector ¶
func (s *MinSelector) NewUIntSelector() execute.DoUIntRowSelector
func (*MinSelector) Rows ¶
func (s *MinSelector) Rows() []execute.Row
type MinUIntSelector ¶
type MinUIntSelector struct {
MinSelector
// contains filtered or unexported fields
}
type MutationRegistrar ¶
type MutationRegistrar struct {
Kind query.OperationKind
Args map[string]semantic.Type
Create query.CreateOperationSpec
New query.NewOperationSpec
}
A MutationRegistrar contains information needed to register a type of Operation Spec that will be converted into a SchemaMutator and embedded in a SchemaMutationProcedureSpec. Operations with a corresponding MutationRegistrar should not have their own ProcedureSpec.
func (MutationRegistrar) Register ¶
func (m MutationRegistrar) Register()
type PercentileAgg ¶
type PercentileAgg struct {
Quantile,
Compression float64
// contains filtered or unexported fields
}
func (*PercentileAgg) Copy ¶
func (a *PercentileAgg) Copy() *PercentileAgg
func (*PercentileAgg) DoFloat ¶
func (a *PercentileAgg) DoFloat(vs []float64)
func (*PercentileAgg) NewBoolAgg ¶
func (a *PercentileAgg) NewBoolAgg() execute.DoBoolAgg
func (*PercentileAgg) NewFloatAgg ¶
func (a *PercentileAgg) NewFloatAgg() execute.DoFloatAgg
func (*PercentileAgg) NewIntAgg ¶
func (a *PercentileAgg) NewIntAgg() execute.DoIntAgg
func (*PercentileAgg) NewStringAgg ¶
func (a *PercentileAgg) NewStringAgg() execute.DoStringAgg
func (*PercentileAgg) NewUIntAgg ¶
func (a *PercentileAgg) NewUIntAgg() execute.DoUIntAgg
func (*PercentileAgg) Type ¶
func (a *PercentileAgg) Type() query.DataType
func (*PercentileAgg) ValueFloat ¶
func (a *PercentileAgg) ValueFloat() float64
type PercentileOpSpec ¶
type PercentileOpSpec struct {
Percentile float64 `json:"percentile"`
Compression float64 `json:"compression"`
Method string `json:"method"`
// percentile is either an aggregate, or a selector based on the options
execute.AggregateConfig
execute.SelectorConfig
}
func (*PercentileOpSpec) Kind ¶
func (s *PercentileOpSpec) Kind() query.OperationKind
type PivotOpSpec ¶
type PivotOpSpec struct {
RowKey []string `json:"rowKey"`
ColKey []string `json:"colKey"`
ValueCol string `json:"valueCol"`
}
func (*PivotOpSpec) Kind ¶
func (s *PivotOpSpec) Kind() query.OperationKind
type PivotProcedureSpec ¶
func (*PivotProcedureSpec) Copy ¶
func (s *PivotProcedureSpec) Copy() plan.ProcedureSpec
func (*PivotProcedureSpec) Kind ¶
func (s *PivotProcedureSpec) Kind() plan.ProcedureKind
type PredictLinearOpSpec ¶
type PredictLinearOpSpec struct {
ValueDst string `json:"value_dst"`
WantedValue float64 `json:"wanted_value"`
execute.AggregateConfig
}
func (*PredictLinearOpSpec) Kind ¶
func (s *PredictLinearOpSpec) Kind() query.OperationKind
type PredictLinearProcedureSpec ¶
type PredictLinearProcedureSpec struct {
ValueLabel string
WantedValue float64
execute.AggregateConfig
}
func (*PredictLinearProcedureSpec) Copy ¶
func (s *PredictLinearProcedureSpec) Copy() plan.ProcedureSpec
func (*PredictLinearProcedureSpec) Kind ¶
func (s *PredictLinearProcedureSpec) Kind() plan.ProcedureKind
type PredictLinearTransformation ¶
type PredictLinearTransformation struct {
// contains filtered or unexported fields
}
func NewPredictLinearTransformation ¶
func NewPredictLinearTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *PredictLinearProcedureSpec) *PredictLinearTransformation
func (*PredictLinearTransformation) DoFloat ¶
func (t *PredictLinearTransformation) DoFloat(ys []float64, xs []values.Time)
func (*PredictLinearTransformation) DoInt ¶
func (t *PredictLinearTransformation) DoInt(ys []int64, xs []values.Time)
func (*PredictLinearTransformation) Finish ¶
func (t *PredictLinearTransformation) Finish(id execute.DatasetID, err error)
func (*PredictLinearTransformation) RetractTable ¶
func (*PredictLinearTransformation) UpdateProcessingTime ¶
func (*PredictLinearTransformation) UpdateWatermark ¶
type RangeOpSpec ¶
type RangeOpSpec struct {
Start query.Time `json:"start"`
Stop query.Time `json:"stop"`
TimeCol string `json:"timeCol"`
StartCol string `json:"startCol"`
StopCol string `json:"stopCol"`
}
func (*RangeOpSpec) Kind ¶
func (s *RangeOpSpec) Kind() query.OperationKind
type RangeProcedureSpec ¶
type RangeProcedureSpec struct {
Bounds query.Bounds
TimeCol string
StartCol string
StopCol string
}
func (*RangeProcedureSpec) Copy ¶
func (s *RangeProcedureSpec) Copy() plan.ProcedureSpec
func (*RangeProcedureSpec) Kind ¶
func (s *RangeProcedureSpec) Kind() plan.ProcedureKind
func (*RangeProcedureSpec) PushDown ¶
func (s *RangeProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*RangeProcedureSpec) PushDownRules ¶
func (s *RangeProcedureSpec) PushDownRules() []plan.PushDownRule
func (*RangeProcedureSpec) TimeBounds ¶
func (s *RangeProcedureSpec) TimeBounds() query.Bounds
type RenameMutator ¶
type RenameMutator struct {
Cols map[string]string
Fn compiler.Func
Scope map[string]values.Value
ParamName string
}
func NewRenameMutator ¶
func NewRenameMutator(qs query.OperationSpec) (*RenameMutator, error)
func (*RenameMutator) Mutate ¶
func (m *RenameMutator) Mutate(ctx *BuilderContext) error
type RenameOpSpec ¶
type RenameOpSpec struct {
Cols map[string]string `json:"columns"`
Fn *semantic.FunctionExpression `json:"fn"`
}
func (*RenameOpSpec) Copy ¶
func (s *RenameOpSpec) Copy() SchemaMutation
func (*RenameOpSpec) Kind ¶
func (s *RenameOpSpec) Kind() query.OperationKind
func (*RenameOpSpec) Mutator ¶
func (s *RenameOpSpec) Mutator() (SchemaMutator, error)
type SampleOpSpec ¶
type SampleOpSpec struct {
N int64 `json:"n"`
Pos int64 `json:"pos"`
execute.SelectorConfig
}
func (*SampleOpSpec) Kind ¶
func (s *SampleOpSpec) Kind() query.OperationKind
type SampleProcedureSpec ¶
type SampleProcedureSpec struct {
N int64
Pos int64
execute.SelectorConfig
}
func (*SampleProcedureSpec) Copy ¶
func (s *SampleProcedureSpec) Copy() plan.ProcedureSpec
func (*SampleProcedureSpec) Kind ¶
func (s *SampleProcedureSpec) Kind() plan.ProcedureKind
type SampleSelector ¶
func (*SampleSelector) DoBool ¶
func (s *SampleSelector) DoBool(vs []bool) []int
func (*SampleSelector) DoFloat ¶
func (s *SampleSelector) DoFloat(vs []float64) []int
func (*SampleSelector) DoInt ¶
func (s *SampleSelector) DoInt(vs []int64) []int
func (*SampleSelector) DoString ¶
func (s *SampleSelector) DoString(vs []string) []int
func (*SampleSelector) DoUInt ¶
func (s *SampleSelector) DoUInt(vs []uint64) []int
func (*SampleSelector) NewBoolSelector ¶
func (s *SampleSelector) NewBoolSelector() execute.DoBoolIndexSelector
func (*SampleSelector) NewFloatSelector ¶
func (s *SampleSelector) NewFloatSelector() execute.DoFloatIndexSelector
func (*SampleSelector) NewIntSelector ¶
func (s *SampleSelector) NewIntSelector() execute.DoIntIndexSelector
func (*SampleSelector) NewStringSelector ¶
func (s *SampleSelector) NewStringSelector() execute.DoStringIndexSelector
func (*SampleSelector) NewUIntSelector ¶
func (s *SampleSelector) NewUIntSelector() execute.DoUIntIndexSelector
type SchemaMutation ¶
type SchemaMutation interface {
Mutator() (SchemaMutator, error)
Copy() SchemaMutation
}
type SchemaMutationProcedureSpec ¶
type SchemaMutationProcedureSpec struct {
Mutations []SchemaMutation
}
func (*SchemaMutationProcedureSpec) Copy ¶
func (s *SchemaMutationProcedureSpec) Copy() plan.ProcedureSpec
func (*SchemaMutationProcedureSpec) Kind ¶
func (s *SchemaMutationProcedureSpec) Kind() plan.ProcedureKind
type SchemaMutator ¶
type SchemaMutator interface {
Mutate(ctx *BuilderContext) error
}
type SetProcedureSpec ¶
type SetProcedureSpec struct {
Key, Value string
}
func (*SetProcedureSpec) Copy ¶
func (s *SetProcedureSpec) Copy() plan.ProcedureSpec
func (*SetProcedureSpec) Kind ¶
func (s *SetProcedureSpec) Kind() plan.ProcedureKind
type ShiftOpSpec ¶
func (*ShiftOpSpec) Kind ¶
func (s *ShiftOpSpec) Kind() query.OperationKind
type ShiftProcedureSpec ¶
func (*ShiftProcedureSpec) Copy ¶
func (s *ShiftProcedureSpec) Copy() plan.ProcedureSpec
func (*ShiftProcedureSpec) Kind ¶
func (s *ShiftProcedureSpec) Kind() plan.ProcedureKind
type SkewAgg ¶
type SkewAgg struct {
// contains filtered or unexported fields
}
func (*SkewAgg) NewBoolAgg ¶
func (*SkewAgg) NewFloatAgg ¶
func (a *SkewAgg) NewFloatAgg() execute.DoFloatAgg
func (*SkewAgg) NewStringAgg ¶
func (a *SkewAgg) NewStringAgg() execute.DoStringAgg
func (*SkewAgg) NewUIntAgg ¶
func (*SkewAgg) ValueFloat ¶
type SkewOpSpec ¶
type SkewOpSpec struct {
execute.AggregateConfig
}
func (*SkewOpSpec) Kind ¶
func (s *SkewOpSpec) Kind() query.OperationKind
type SkewProcedureSpec ¶
type SkewProcedureSpec struct {
execute.AggregateConfig
}
func (*SkewProcedureSpec) Copy ¶
func (s *SkewProcedureSpec) Copy() plan.ProcedureSpec
func (*SkewProcedureSpec) Kind ¶
func (s *SkewProcedureSpec) Kind() plan.ProcedureKind
type SortOpSpec ¶
func (*SortOpSpec) Kind ¶
func (s *SortOpSpec) Kind() query.OperationKind
type SortProcedureSpec ¶
func (*SortProcedureSpec) Copy ¶
func (s *SortProcedureSpec) Copy() plan.ProcedureSpec
func (*SortProcedureSpec) Kind ¶
func (s *SortProcedureSpec) Kind() plan.ProcedureKind
type SpreadAgg ¶
type SpreadAgg struct {
// contains filtered or unexported fields
}
SpreadAgg finds the difference between the max and min values a table
func (*SpreadAgg) NewBoolAgg ¶
func (*SpreadAgg) NewFloatAgg ¶
func (a *SpreadAgg) NewFloatAgg() execute.DoFloatAgg
func (*SpreadAgg) NewStringAgg ¶
func (a *SpreadAgg) NewStringAgg() execute.DoStringAgg
func (*SpreadAgg) NewUIntAgg ¶
type SpreadFloatAgg ¶
type SpreadFloatAgg struct {
SpreadAgg
// contains filtered or unexported fields
}
func (*SpreadFloatAgg) DoFloat ¶
func (a *SpreadFloatAgg) DoFloat(vs []float64)
Do searches for the min and max value of the array and caches them in the aggregate
func (*SpreadFloatAgg) Type ¶
func (a *SpreadFloatAgg) Type() query.DataType
func (*SpreadFloatAgg) ValueFloat ¶
func (a *SpreadFloatAgg) ValueFloat() float64
Value returns the difference between max and min
type SpreadIntAgg ¶
type SpreadIntAgg struct {
SpreadAgg
// contains filtered or unexported fields
}
func (*SpreadIntAgg) DoInt ¶
func (a *SpreadIntAgg) DoInt(vs []int64)
DoInt searches for the min and max value of the array and caches them in the aggregate
func (*SpreadIntAgg) Type ¶
func (a *SpreadIntAgg) Type() query.DataType
func (*SpreadIntAgg) ValueInt ¶
func (a *SpreadIntAgg) ValueInt() int64
Value returns the difference between max and min
type SpreadOpSpec ¶
type SpreadOpSpec struct {
execute.AggregateConfig
}
SpreadOpSpec defines the required arguments for Flux. Currently, spread takes no arguments.
func (*SpreadOpSpec) Kind ¶
func (s *SpreadOpSpec) Kind() query.OperationKind
Kind is used to lookup createSpreadOpSpec producing SpreadOpSpec
type SpreadProcedureSpec ¶
type SpreadProcedureSpec struct {
execute.AggregateConfig
}
SpreadProcedureSpec is created when mapping from SpreadOpSpec.Kind to a CreateProcedureSpec.
func (*SpreadProcedureSpec) Copy ¶
func (s *SpreadProcedureSpec) Copy() plan.ProcedureSpec
func (*SpreadProcedureSpec) Kind ¶
func (s *SpreadProcedureSpec) Kind() plan.ProcedureKind
Kind is used to lookup CreateTransformation producing SpreadAgg
type SpreadUIntAgg ¶
type SpreadUIntAgg struct {
SpreadAgg
// contains filtered or unexported fields
}
func (*SpreadUIntAgg) DoUInt ¶
func (a *SpreadUIntAgg) DoUInt(vs []uint64)
Do searches for the min and max value of the array and caches them in the aggregate
func (*SpreadUIntAgg) Type ¶
func (a *SpreadUIntAgg) Type() query.DataType
func (*SpreadUIntAgg) ValueUInt ¶
func (a *SpreadUIntAgg) ValueUInt() uint64
Value returns the difference between max and min
type StateTrackingOpSpec ¶
type StateTrackingOpSpec struct {
Fn *semantic.FunctionExpression `json:"fn"`
CountLabel string `json:"countLabel"`
DurationLabel string `json:"durationLabel"`
DurationUnit query.Duration `json:"durationUnit"`
TimeCol string `json:"timeCol"`
}
func (*StateTrackingOpSpec) Kind ¶
func (s *StateTrackingOpSpec) Kind() query.OperationKind
type StateTrackingProcedureSpec ¶
type StateTrackingProcedureSpec struct {
Fn *semantic.FunctionExpression
CountLabel,
DurationLabel string
DurationUnit query.Duration
TimeCol string
}
func (*StateTrackingProcedureSpec) Copy ¶
func (s *StateTrackingProcedureSpec) Copy() plan.ProcedureSpec
func (*StateTrackingProcedureSpec) Kind ¶
func (s *StateTrackingProcedureSpec) Kind() plan.ProcedureKind
type StddevAgg ¶
type StddevAgg struct {
// contains filtered or unexported fields
}
func (*StddevAgg) NewBoolAgg ¶
func (*StddevAgg) NewFloatAgg ¶
func (a *StddevAgg) NewFloatAgg() execute.DoFloatAgg
func (*StddevAgg) NewStringAgg ¶
func (a *StddevAgg) NewStringAgg() execute.DoStringAgg
func (*StddevAgg) NewUIntAgg ¶
func (*StddevAgg) ValueFloat ¶
type StddevOpSpec ¶
type StddevOpSpec struct {
execute.AggregateConfig
}
func (*StddevOpSpec) Kind ¶
func (s *StddevOpSpec) Kind() query.OperationKind
type StddevProcedureSpec ¶
type StddevProcedureSpec struct {
execute.AggregateConfig
}
func (*StddevProcedureSpec) Copy ¶
func (s *StddevProcedureSpec) Copy() plan.ProcedureSpec
func (*StddevProcedureSpec) Kind ¶
func (s *StddevProcedureSpec) Kind() plan.ProcedureKind
type SumAgg ¶
type SumAgg struct{}
func (*SumAgg) NewBoolAgg ¶
func (*SumAgg) NewFloatAgg ¶
func (a *SumAgg) NewFloatAgg() execute.DoFloatAgg
func (*SumAgg) NewStringAgg ¶
func (a *SumAgg) NewStringAgg() execute.DoStringAgg
func (*SumAgg) NewUIntAgg ¶
type SumFloatAgg ¶
type SumFloatAgg struct {
// contains filtered or unexported fields
}
func (*SumFloatAgg) DoFloat ¶
func (a *SumFloatAgg) DoFloat(vs []float64)
func (*SumFloatAgg) Type ¶
func (a *SumFloatAgg) Type() query.DataType
func (*SumFloatAgg) ValueFloat ¶
func (a *SumFloatAgg) ValueFloat() float64
type SumOpSpec ¶
type SumOpSpec struct {
execute.AggregateConfig
}
func (*SumOpSpec) Kind ¶
func (s *SumOpSpec) Kind() query.OperationKind
type SumProcedureSpec ¶
type SumProcedureSpec struct {
execute.AggregateConfig
}
func (*SumProcedureSpec) AggregateMethod ¶
func (s *SumProcedureSpec) AggregateMethod() string
func (*SumProcedureSpec) Copy ¶
func (s *SumProcedureSpec) Copy() plan.ProcedureSpec
func (*SumProcedureSpec) Kind ¶
func (s *SumProcedureSpec) Kind() plan.ProcedureKind
func (*SumProcedureSpec) PushDown ¶
func (s *SumProcedureSpec) PushDown(root *plan.Procedure, dup func() *plan.Procedure)
func (*SumProcedureSpec) PushDownRules ¶
func (s *SumProcedureSpec) PushDownRules() []plan.PushDownRule
func (*SumProcedureSpec) ReAggregateSpec ¶
func (s *SumProcedureSpec) ReAggregateSpec() plan.ProcedureSpec
type SumUIntAgg ¶
type SumUIntAgg struct {
// contains filtered or unexported fields
}
func (*SumUIntAgg) DoUInt ¶
func (a *SumUIntAgg) DoUInt(vs []uint64)
func (*SumUIntAgg) Type ¶
func (a *SumUIntAgg) Type() query.DataType
func (*SumUIntAgg) ValueUInt ¶
func (a *SumUIntAgg) ValueUInt() uint64
type TDigestPercentileProcedureSpec ¶
type TDigestPercentileProcedureSpec struct {
Percentile float64 `json:"percentile"`
Compression float64 `json:"compression"`
execute.AggregateConfig
}
func (*TDigestPercentileProcedureSpec) Copy ¶
func (s *TDigestPercentileProcedureSpec) Copy() plan.ProcedureSpec
func (*TDigestPercentileProcedureSpec) Kind ¶
func (s *TDigestPercentileProcedureSpec) Kind() plan.ProcedureKind
type ToHTTPOpSpec ¶
type ToHTTPOpSpec struct {
URL string `json:"url"`
Method string `json:"method"` // default behavior should be POST
Name string `json:"name"`
NameColumn string `json:"nameColumn"` // either name or name_column must be set, if none is set try to use the "_measurement" column.
Headers map[string]string `json:"headers"` // TODO: implement Headers after bug with keys and arrays and objects is fixed (new parser implemented, with string literals as keys)
URLParams map[string]string `json:"urlParams"` // TODO: implement URLParams after bug with keys and arrays and objects is fixed (new parser implemented, with string literals as keys)
Timeout time.Duration `json:"timeout"` // default to something reasonable if zero
NoKeepAlive bool `json:"noKeepAlive"`
TimeColumn string `json:"timeColumn"`
TagColumns []string `json:"tagColumns"`
ValueColumns []string `json:"valueColumns"`
}
func (ToHTTPOpSpec) Kind ¶
func (ToHTTPOpSpec) Kind() query.OperationKind
func (*ToHTTPOpSpec) ReadArgs ¶
func (o *ToHTTPOpSpec) ReadArgs(args query.Arguments) error
ReadArgs loads a query.Arguments into ToHTTPOpSpec. It sets several default values. If the http method isn't set, it defaults to POST, it also uppercases the http method. If the time_column isn't set, it defaults to execute.TimeColLabel. If the value_column isn't set it defaults to a []string{execute.DefaultValueColLabel}.
func (*ToHTTPOpSpec) UnmarshalJSON ¶
func (o *ToHTTPOpSpec) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON unmarshals and validates toHTTPOpSpec into JSON.
type ToHTTPProcedureSpec ¶
type ToHTTPProcedureSpec struct {
Spec *ToHTTPOpSpec
}
func (*ToHTTPProcedureSpec) Copy ¶
func (o *ToHTTPProcedureSpec) Copy() plan.ProcedureSpec
func (*ToHTTPProcedureSpec) Kind ¶
func (o *ToHTTPProcedureSpec) Kind() plan.ProcedureKind
type ToHTTPTransformation ¶
type ToHTTPTransformation struct {
// contains filtered or unexported fields
}
func NewToHTTPTransformation ¶
func NewToHTTPTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ToHTTPProcedureSpec) *ToHTTPTransformation
func (*ToHTTPTransformation) Finish ¶
func (t *ToHTTPTransformation) Finish(id execute.DatasetID, err error)
func (*ToHTTPTransformation) RetractTable ¶
func (*ToHTTPTransformation) UpdateProcessingTime ¶
func (*ToHTTPTransformation) UpdateWatermark ¶
type ToKafkaOpSpec ¶
type ToKafkaOpSpec struct {
Brokers []string `json:"brokers"`
Topic string `json:"topic"`
Balancer string `json:"balancer"`
Name string `json:"name"`
NameColumn string `json:"nameColumn"` // either name or name_column must be set, if none is set try to use the "_measurement" column.
TimeColumn string `json:"timeColumn"`
TagColumns []string `json:"tagColumns"`
ValueColumns []string `json:"valueColumns"`
MsgBufSize int `json:"msgBufferSize"` // the maximim number of messages to buffer before sending to kafka, the library we use defaults to 100
}
func (ToKafkaOpSpec) Kind ¶
func (ToKafkaOpSpec) Kind() query.OperationKind
func (*ToKafkaOpSpec) ReadArgs ¶
func (o *ToKafkaOpSpec) ReadArgs(args query.Arguments) error
ReadArgs loads a query.Arguments into ToKafkaOpSpec. It sets several default values. If the time_column isn't set, it defaults to execute.TimeColLabel. If the value_column isn't set it defaults to a []string{execute.DefaultValueColLabel}.
type ToKafkaProcedureSpec ¶
type ToKafkaProcedureSpec struct {
Spec *ToKafkaOpSpec
// contains filtered or unexported fields
}
func (*ToKafkaProcedureSpec) Copy ¶
func (o *ToKafkaProcedureSpec) Copy() plan.ProcedureSpec
func (*ToKafkaProcedureSpec) Kind ¶
func (o *ToKafkaProcedureSpec) Kind() plan.ProcedureKind
type ToKafkaTransformation ¶
type ToKafkaTransformation struct {
// contains filtered or unexported fields
}
func NewToKafkaTransformation ¶
func NewToKafkaTransformation(d execute.Dataset, cache execute.TableBuilderCache, spec *ToKafkaProcedureSpec) *ToKafkaTransformation
func (*ToKafkaTransformation) Finish ¶
func (t *ToKafkaTransformation) Finish(id execute.DatasetID, err error)
func (*ToKafkaTransformation) RetractTable ¶
func (*ToKafkaTransformation) UpdateProcessingTime ¶
func (*ToKafkaTransformation) UpdateWatermark ¶
type UnionOpSpec ¶
type UnionOpSpec struct {
}
func (*UnionOpSpec) Kind ¶
func (s *UnionOpSpec) Kind() flux.OperationKind
type UnionProcedureSpec ¶
type UnionProcedureSpec struct {
}
func (*UnionProcedureSpec) Copy ¶
func (s *UnionProcedureSpec) Copy() plan.ProcedureSpec
func (*UnionProcedureSpec) Kind ¶
func (s *UnionProcedureSpec) Kind() plan.ProcedureKind
type UniqueOpSpec ¶
type UniqueOpSpec struct {
Column string `json:"column"`
}
func (*UniqueOpSpec) Kind ¶
func (s *UniqueOpSpec) Kind() query.OperationKind
type UniqueProcedureSpec ¶
type UniqueProcedureSpec struct {
Column string
}
func (*UniqueProcedureSpec) Copy ¶
func (s *UniqueProcedureSpec) Copy() plan.ProcedureSpec
func (*UniqueProcedureSpec) Kind ¶
func (s *UniqueProcedureSpec) Kind() plan.ProcedureKind
type WindowOpSpec ¶
type WindowOpSpec struct {
Every query.Duration `json:"every"`
Period query.Duration `json:"period"`
Start query.Time `json:"start"`
Round query.Duration `json:"round"`
Triggering query.TriggerSpec `json:"triggering"`
TimeCol string `json:"time_col"`
StopColLabel string `json:"stop_col_label"`
StartColLabel string `json:"start_col_label"`
CreateEmpty bool `json:"createEmpty"`
}
func (*WindowOpSpec) Kind ¶
func (s *WindowOpSpec) Kind() query.OperationKind
type WindowProcedureSpec ¶
type WindowProcedureSpec struct {
Window plan.WindowSpec
Triggering query.TriggerSpec
TimeCol,
StartColLabel,
StopColLabel string
CreateEmpty bool
}
func (*WindowProcedureSpec) Copy ¶
func (s *WindowProcedureSpec) Copy() plan.ProcedureSpec
func (*WindowProcedureSpec) Kind ¶
func (s *WindowProcedureSpec) Kind() plan.ProcedureKind
func (*WindowProcedureSpec) TriggerSpec ¶
func (s *WindowProcedureSpec) TriggerSpec() query.TriggerSpec
type YieldOpSpec ¶
type YieldOpSpec struct {
Name string `json:"name"`
}
func (*YieldOpSpec) Kind ¶
func (s *YieldOpSpec) Kind() query.OperationKind
type YieldProcedureSpec ¶
type YieldProcedureSpec struct {
Name string `json:"name"`
}
func (*YieldProcedureSpec) Copy ¶
func (s *YieldProcedureSpec) Copy() plan.ProcedureSpec
func (*YieldProcedureSpec) Kind ¶
func (s *YieldProcedureSpec) Kind() plan.ProcedureKind
func (*YieldProcedureSpec) YieldName ¶
func (s *YieldProcedureSpec) YieldName() string
Source Files
¶
- count.go
- covariance.go
- cumulative_sum.go
- dedup.go
- derivative.go
- difference.go
- distinct.go
- doc.go
- filter.go
- first.go
- from.go
- from_csv.go
- functions.go
- group.go
- histogram.go
- histogram_quantile.go
- increase.go
- integral.go
- join.go
- keys.go
- last.go
- limit.go
- map.go
- max.go
- mean.go
- min.go
- percentile.go
- pivot.go
- predict_linear.go
- range.go
- sample.go
- schema_functions.go
- schema_mutators.go
- set.go
- shift.go
- skew.go
- sort.go
- spread.go
- state_tracking.go
- stddev.go
- sum.go
- system_time.go
- to_http.go
- to_kafka.go
- top_bottom.go
- typeconv.go
- union.go
- unique.go
- window.go
- yield.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package storage implements reading from a storage engine into a table as a data source.
|
Package storage implements reading from a storage engine into a table as a data source. |