Documentation
¶
Index ¶
- Constants
- Variables
- func ColumnTypePrecedence(ct ColumnType) int
- type BinaryOp
- type BoolLiteral
- type Bytes
- type BytesLiteral
- type ColumnRef
- type ColumnType
- type DataType
- type Duration
- type DurationLiteral
- type FloatLiteral
- type IntegerLiteral
- type Literal
- type LiteralType
- type NullLiteral
- type RangeAggregationType
- type StringLiteral
- type Timestamp
- type TimestampLiteral
- type Type
- type TypedLiteral
- type UnaryOp
- type VectorAggregationType
Constants ¶
const ( PrecedenceGenerated = iota // 0 - highest precedence PrecedenceParsed // 1 PrecedenceMetadata // 2 PrecedenceLabel // 3 PrecedenceBuiltin // 4 - lowest precedence )
Column type precedence for ambiguous column resolution (highest to lowest): Generated > Parsed > Metadata > Label > Builtin
const ( ColumnNameBuiltinTimestamp = "timestamp" ColumnNameBuiltinMessage = "message" ColumnNameGeneratedValue = "value" MetadataKeyColumnType = "column_type" MetadataKeyColumnDataType = "column_datatype" )
Names of the builtin columns.
const ( ColumnNameError = "__error__" ColumnNameErrorDetails = "__error_details__" )
Names of error columns
const ( LogfmtParserErrorType = "LogfmtParserErr" JSONParserErrorType = "JSONParserErr" SampleExtractionErrorType = "SampleExtractionErr" )
Error types.
Variables ¶
var ( Loki = struct { Null DataType Bool DataType String DataType Integer DataType Float DataType Timestamp DataType Duration DataType Bytes DataType Struct DataType }{ Null: tNull{}, Bool: tBool{}, String: tString{}, Integer: tInteger{}, Float: tFloat{}, Timestamp: tTimestamp{}, Duration: tDuration{}, Bytes: tBytes{}, Struct: tStruct{}, } Arrow = struct { Null arrow.DataType Bool arrow.DataType String arrow.DataType Integer arrow.DataType Float arrow.DataType Timestamp arrow.DataType Duration arrow.DataType Bytes arrow.DataType }{ Null: arrow.Null, Bool: arrow.FixedWidthTypes.Boolean, String: arrow.BinaryTypes.String, Integer: arrow.PrimitiveTypes.Int64, Float: arrow.PrimitiveTypes.Float64, Timestamp: arrow.FixedWidthTypes.Timestamp_ns, Duration: arrow.PrimitiveTypes.Int64, Bytes: arrow.PrimitiveTypes.Int64, } )
var SupportedRangeAggregationTypes = []RangeAggregationType{ RangeAggregationTypeCount, RangeAggregationTypeSum, RangeAggregationTypeMax, RangeAggregationTypeMin, }
var SupportedVectorAggregationTypes = []VectorAggregationType{ VectorAggregationTypeSum, VectorAggregationTypeMax, VectorAggregationTypeMin, VectorAggregationTypeCount, }
Functions ¶
func ColumnTypePrecedence ¶ added in v3.6.0
func ColumnTypePrecedence(ct ColumnType) int
ColumnTypePrecedence returns the precedence of the given ColumnType.
Types ¶
type BinaryOp ¶
type BinaryOp uint32
BinaryOp denotes the kind of BinaryOp operation to perform.
const ( // BinaryOpInvalid indicates an invalid binary operation. BinaryOpInvalid BinaryOp = iota BinaryOpEq // Equality comparison (==). BinaryOpNeq // Inequality comparison (!=). BinaryOpGt // Greater than comparison (>). BinaryOpGte // Greater than or equal comparison (>=). BinaryOpLt // Less than comparison (<). BinaryOpLte // Less than or equal comparison (<=). BinaryOpAnd // Logical AND operation (&&). BinaryOpOr // Logical OR operation (||). BinaryOpXor // Logical XOR operation (^). BinaryOpNot // Logical NOT operation (!). BinaryOpAdd // Addition operation (+). BinaryOpSub // Subtraction operation (-). BinaryOpMul // Multiplication operation (*). BinaryOpDiv // Division operation (/). BinaryOpMod // Modulo operation (%). BinaryOpMatchSubstr // Substring matching operation (|=). Used for string match filter. BinaryOpNotMatchSubstr // Substring non-matching operation (!=). Used for string match filter. BinaryOpMatchRe // Regular expression matching operation (|~). Used for regex match filter and label matcher. BinaryOpNotMatchRe // Regular expression non-matching operation (!~). Used for regex match filter and label matcher. BinaryOpMatchPattern // Pattern matching operation (|>). Used for pattern match filter. BinaryOpNotMatchPattern // Pattern non-matching operation (!>). Use for pattern match filter. )
Recognized values of BinaryOp.
type BoolLiteral ¶ added in v3.6.0
type BoolLiteral bool
func (BoolLiteral) String ¶ added in v3.6.0
func (b BoolLiteral) String() string
String implements Literal.
func (BoolLiteral) Type ¶ added in v3.6.0
func (b BoolLiteral) Type() DataType
Type implements Literal.
func (BoolLiteral) Value ¶ added in v3.6.0
func (b BoolLiteral) Value() bool
type BytesLiteral ¶ added in v3.6.0
type BytesLiteral Bytes
func (BytesLiteral) String ¶ added in v3.6.0
func (b BytesLiteral) String() string
String implements Literal.
func (BytesLiteral) Type ¶ added in v3.6.0
func (b BytesLiteral) Type() DataType
Type implements Literal.
func (BytesLiteral) Value ¶ added in v3.6.0
func (b BytesLiteral) Value() Bytes
type ColumnRef ¶ added in v3.6.0
type ColumnRef struct {
Column string // Name of the column being referenced.
Type ColumnType // Type of the column being referenced.
}
A ColumnRef referenes a column within a table relation.
type ColumnType ¶
type ColumnType int
ColumnType denotes the column type for a ColumnRef.
const ( // ColumnTypeInvalid indicates an invalid column type. ColumnTypeInvalid ColumnType = iota ColumnTypeBuiltin // ColumnTypeBuiltin represents a builtin column (such as timestamp). ColumnTypeLabel // ColumnTypeLabel represents a column from a stream label. ColumnTypeMetadata // ColumnTypeMetadata represents a column from a log metadata. ColumnTypeParsed // ColumnTypeParsed represents a parsed column from a parser stage. ColumnTypeAmbiguous // ColumnTypeAmbiguous represents a column that can either be a builtin, label, metadata, or parsed. ColumnTypeGenerated // ColumnTypeGenerated represents a column that is generated from an expression or computation. )
Recognized values of ColumnType.
func ColumnTypeFromString ¶ added in v3.6.0
func ColumnTypeFromString(ct string) ColumnType
ColumnTypeFromString returns the ColumnType from its string representation.
func (ColumnType) String ¶
func (ct ColumnType) String() string
String returns a human-readable representation of the column type.
type DataType ¶ added in v3.6.0
func FromString ¶ added in v3.6.0
func MustFromString ¶ added in v3.6.0
func NewStructType ¶ added in v3.6.0
func NewStructType(arrowType *arrow.StructType) DataType
NewStructType creates a DataType from an Arrow StructType
type DurationLiteral ¶ added in v3.6.0
type DurationLiteral int64
func (DurationLiteral) Any ¶ added in v3.6.0
func (d DurationLiteral) Any() any
Any implements Literal.
func (DurationLiteral) String ¶ added in v3.6.0
func (d DurationLiteral) String() string
String implements Literal.
func (DurationLiteral) Type ¶ added in v3.6.0
func (d DurationLiteral) Type() DataType
Type implements Literal.
func (DurationLiteral) Value ¶ added in v3.6.0
func (d DurationLiteral) Value() Duration
type FloatLiteral ¶ added in v3.6.0
type FloatLiteral float64
func (FloatLiteral) String ¶ added in v3.6.0
func (f FloatLiteral) String() string
String implements Literal.
func (FloatLiteral) Type ¶ added in v3.6.0
func (f FloatLiteral) Type() DataType
Type implements Literal.
func (FloatLiteral) Value ¶ added in v3.6.0
func (f FloatLiteral) Value() float64
type IntegerLiteral ¶ added in v3.6.0
type IntegerLiteral int64
func (IntegerLiteral) Any ¶ added in v3.6.0
func (i IntegerLiteral) Any() any
Any implements Literal.
func (IntegerLiteral) String ¶ added in v3.6.0
func (i IntegerLiteral) String() string
String implements Literal.
func (IntegerLiteral) Type ¶ added in v3.6.0
func (i IntegerLiteral) Type() DataType
Type implements Literal.
func (IntegerLiteral) Value ¶ added in v3.6.0
func (i IntegerLiteral) Value() int64
type Literal ¶ added in v3.6.0
Literal is holds a value of [any] typed as DataType.
func NewLiteral ¶ added in v3.6.0
func NewLiteral[T LiteralType](value T) Literal
type LiteralType ¶ added in v3.6.0
type NullLiteral ¶ added in v3.6.0
type NullLiteral struct {
}
func NewNullLiteral ¶ added in v3.6.0
func NewNullLiteral() NullLiteral
func (NullLiteral) String ¶ added in v3.6.0
func (n NullLiteral) String() string
String implements Literal.
func (NullLiteral) Type ¶ added in v3.6.0
func (n NullLiteral) Type() DataType
Type implements Literal.
func (NullLiteral) Value ¶ added in v3.6.0
func (n NullLiteral) Value() any
type RangeAggregationType ¶ added in v3.6.0
type RangeAggregationType int
RangeAggregationType represents the type of range aggregation operation
const ( RangeAggregationTypeInvalid RangeAggregationType = iota RangeAggregationTypeCount // Represents count_over_time range aggregation RangeAggregationTypeSum // Represents sum_over_time range aggregation RangeAggregationTypeMax // Represents max_over_time range aggregation RangeAggregationTypeMin // Represents min_over_time range aggregation )
func (RangeAggregationType) String ¶ added in v3.6.0
func (op RangeAggregationType) String() string
type StringLiteral ¶ added in v3.6.0
type StringLiteral string
func (StringLiteral) String ¶ added in v3.6.0
func (s StringLiteral) String() string
String implements Literal.
func (StringLiteral) Type ¶ added in v3.6.0
func (s StringLiteral) Type() DataType
Type implements Literal.
func (StringLiteral) Value ¶ added in v3.6.0
func (s StringLiteral) Value() string
type TimestampLiteral ¶ added in v3.6.0
type TimestampLiteral Timestamp
func (TimestampLiteral) Any ¶ added in v3.6.0
func (t TimestampLiteral) Any() any
Any implements Literal.
func (TimestampLiteral) String ¶ added in v3.6.0
func (t TimestampLiteral) String() string
String implements Literal.
func (TimestampLiteral) Type ¶ added in v3.6.0
func (t TimestampLiteral) Type() DataType
Type implements Literal.
func (TimestampLiteral) Value ¶ added in v3.6.0
func (t TimestampLiteral) Value() Timestamp
type TypedLiteral ¶ added in v3.6.0
type TypedLiteral[T LiteralType] interface { Literal Value() T }
type UnaryOp ¶
type UnaryOp uint32
UnaryOp denotes the kind of UnaryOp operation to perform.
const ( // UnaryOpKindInvalid indicates an invalid unary operation. UnaryOpInvalid UnaryOp = iota UnaryOpNot // Logical NOT operation (!). UnaryOpAbs // Mathematical absolute operation (abs). UnaryOpCastFloat // Cast string to float value operation (unwrap). UnaryOpCastBytes // Cast string bytes to float value operation (unwrap). UnaryOpCastDuration // Cast string duration to float value operation (unwrap). )
Recognized values of UnaryOp.
type VectorAggregationType ¶ added in v3.6.0
type VectorAggregationType int
VectorAggregationType represents the type of vector aggregation operation
const ( VectorAggregationTypeInvalid VectorAggregationType = iota VectorAggregationTypeSum // Represents sum vector aggregation VectorAggregationTypeMax // Represents max vector aggregation VectorAggregationTypeMin // Represents min vector aggregation VectorAggregationTypeCount // Represents count vector aggregation VectorAggregationTypeAvg // Represents avg vector aggregation VectorAggregationTypeStddev // Represents stddev vector aggregation VectorAggregationTypeStdvar // Represents stdvar vector aggregation VectorAggregationTypeBottomK // Represents bottomk vector aggregation VectorAggregationTypeTopK // Represents topk vector aggregation VectorAggregationTypeSort // Represents sort vector aggregation VectorAggregationTypeSortDesc // Represents sort_desc vector aggregation )
func (VectorAggregationType) String ¶ added in v3.6.0
func (op VectorAggregationType) String() string