Documentation
¶
Overview ¶
Package expr provides expression evaluation for DataFrame operations
Index ¶
- type AggregationExpr
- type AggregationType
- type BinaryExpr
- func (b *BinaryExpr) Abs() *FunctionExpr
- func (b *BinaryExpr) Add(other Expr) *BinaryExpr
- func (b *BinaryExpr) And(other Expr) *BinaryExpr
- func (b *BinaryExpr) Ceil() *FunctionExpr
- func (b *BinaryExpr) Cos() *FunctionExpr
- func (b *BinaryExpr) Div(other Expr) *BinaryExpr
- func (b *BinaryExpr) Floor() *FunctionExpr
- func (b *BinaryExpr) Left() Expr
- func (b *BinaryExpr) Log() *FunctionExpr
- func (b *BinaryExpr) Mul(other Expr) *BinaryExpr
- func (b *BinaryExpr) Op() BinaryOp
- func (b *BinaryExpr) Or(other Expr) *BinaryExpr
- func (b *BinaryExpr) Right() Expr
- func (b *BinaryExpr) Round() *FunctionExpr
- func (b *BinaryExpr) RoundTo(precision Expr) *FunctionExpr
- func (b *BinaryExpr) Sin() *FunctionExpr
- func (b *BinaryExpr) Sqrt() *FunctionExpr
- func (b *BinaryExpr) String() string
- func (b *BinaryExpr) Sub(other Expr) *BinaryExpr
- func (b *BinaryExpr) Type() ExprType
- type BinaryOp
- type CaseExpr
- type CaseWhen
- type ColumnExpr
- func (c *ColumnExpr) Abs() *FunctionExpr
- func (c *ColumnExpr) Add(other Expr) *BinaryExpr
- func (c *ColumnExpr) CastToBool() *FunctionExpr
- func (c *ColumnExpr) CastToFloat64() *FunctionExpr
- func (c *ColumnExpr) CastToInt64() *FunctionExpr
- func (c *ColumnExpr) CastToString() *FunctionExpr
- func (c *ColumnExpr) Ceil() *FunctionExpr
- func (c *ColumnExpr) Cos() *FunctionExpr
- func (c *ColumnExpr) Count() *AggregationExpr
- func (c *ColumnExpr) Div(other Expr) *BinaryExpr
- func (c *ColumnExpr) Eq(other Expr) *BinaryExpr
- func (c *ColumnExpr) Floor() *FunctionExpr
- func (c *ColumnExpr) Ge(other Expr) *BinaryExpr
- func (c *ColumnExpr) Gt(other Expr) *BinaryExpr
- func (c *ColumnExpr) Le(other Expr) *BinaryExpr
- func (c *ColumnExpr) Length() *FunctionExpr
- func (c *ColumnExpr) Log() *FunctionExpr
- func (c *ColumnExpr) Lower() *FunctionExpr
- func (c *ColumnExpr) Lt(other Expr) *BinaryExpr
- func (c *ColumnExpr) Max() *AggregationExpr
- func (c *ColumnExpr) Mean() *AggregationExpr
- func (c *ColumnExpr) Min() *AggregationExpr
- func (c *ColumnExpr) Mul(other Expr) *BinaryExpr
- func (c *ColumnExpr) Name() string
- func (c *ColumnExpr) Ne(other Expr) *BinaryExpr
- func (c *ColumnExpr) Neg() *UnaryExpr
- func (c *ColumnExpr) Not() *UnaryExpr
- func (c *ColumnExpr) Round() *FunctionExpr
- func (c *ColumnExpr) RoundTo(precision Expr) *FunctionExpr
- func (c *ColumnExpr) Sin() *FunctionExpr
- func (c *ColumnExpr) Sqrt() *FunctionExpr
- func (c *ColumnExpr) String() string
- func (c *ColumnExpr) Sub(other Expr) *BinaryExpr
- func (c *ColumnExpr) Substring(start, length Expr) *FunctionExpr
- func (c *ColumnExpr) Sum() *AggregationExpr
- func (c *ColumnExpr) Trim() *FunctionExpr
- func (c *ColumnExpr) Type() ExprType
- func (c *ColumnExpr) Upper() *FunctionExpr
- type Evaluator
- type Expr
- type ExprType
- type FunctionExpr
- func (f *FunctionExpr) Abs() *FunctionExpr
- func (f *FunctionExpr) Add(other Expr) *BinaryExpr
- func (f *FunctionExpr) And(other Expr) *BinaryExpr
- func (f *FunctionExpr) Args() []Expr
- func (f *FunctionExpr) CastToBool() *FunctionExpr
- func (f *FunctionExpr) CastToFloat64() *FunctionExpr
- func (f *FunctionExpr) CastToInt64() *FunctionExpr
- func (f *FunctionExpr) CastToString() *FunctionExpr
- func (f *FunctionExpr) Ceil() *FunctionExpr
- func (f *FunctionExpr) Cos() *FunctionExpr
- func (f *FunctionExpr) Div(other Expr) *BinaryExpr
- func (f *FunctionExpr) Eq(other Expr) *BinaryExpr
- func (f *FunctionExpr) Floor() *FunctionExpr
- func (f *FunctionExpr) Ge(other Expr) *BinaryExpr
- func (f *FunctionExpr) Gt(other Expr) *BinaryExpr
- func (f *FunctionExpr) Le(other Expr) *BinaryExpr
- func (f *FunctionExpr) Length() *FunctionExpr
- func (f *FunctionExpr) Log() *FunctionExpr
- func (f *FunctionExpr) Lower() *FunctionExpr
- func (f *FunctionExpr) Lt(other Expr) *BinaryExpr
- func (f *FunctionExpr) Mul(other Expr) *BinaryExpr
- func (f *FunctionExpr) Name() string
- func (f *FunctionExpr) Ne(other Expr) *BinaryExpr
- func (f *FunctionExpr) Neg() *UnaryExpr
- func (f *FunctionExpr) Not() *UnaryExpr
- func (f *FunctionExpr) Or(other Expr) *BinaryExpr
- func (f *FunctionExpr) Round() *FunctionExpr
- func (f *FunctionExpr) RoundTo(precision Expr) *FunctionExpr
- func (f *FunctionExpr) Sin() *FunctionExpr
- func (f *FunctionExpr) Sqrt() *FunctionExpr
- func (f *FunctionExpr) String() string
- func (f *FunctionExpr) Sub(other Expr) *BinaryExpr
- func (f *FunctionExpr) Substring(start, length Expr) *FunctionExpr
- func (f *FunctionExpr) Trim() *FunctionExpr
- func (f *FunctionExpr) Type() ExprType
- func (f *FunctionExpr) Upper() *FunctionExpr
- type InvalidExpr
- type LiteralExpr
- type UnaryExpr
- type UnaryOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregationExpr ¶
type AggregationExpr struct {
// contains filtered or unexported fields
}
AggregationExpr represents an aggregation function over a column
func (*AggregationExpr) AggType ¶
func (a *AggregationExpr) AggType() AggregationType
func (*AggregationExpr) Alias ¶
func (a *AggregationExpr) Alias() string
func (*AggregationExpr) As ¶
func (a *AggregationExpr) As(alias string) *AggregationExpr
As sets an alias for the aggregation expression
func (*AggregationExpr) Column ¶
func (a *AggregationExpr) Column() Expr
func (*AggregationExpr) String ¶
func (a *AggregationExpr) String() string
func (*AggregationExpr) Type ¶
func (a *AggregationExpr) Type() ExprType
type AggregationType ¶
type AggregationType int
AggregationType represents the type of aggregation function
const ( AggSum AggregationType = iota AggCount AggMean AggMin AggMax )
type BinaryExpr ¶
type BinaryExpr struct {
// contains filtered or unexported fields
}
BinaryExpr represents a binary operation
func (*BinaryExpr) Abs ¶
func (b *BinaryExpr) Abs() *FunctionExpr
Abs creates an absolute value function expression
func (*BinaryExpr) Add ¶
func (b *BinaryExpr) Add(other Expr) *BinaryExpr
Add creates an addition expression
func (*BinaryExpr) And ¶
func (b *BinaryExpr) And(other Expr) *BinaryExpr
And creates a logical AND expression
func (*BinaryExpr) Ceil ¶
func (b *BinaryExpr) Ceil() *FunctionExpr
Ceil creates a ceil function expression
func (*BinaryExpr) Cos ¶
func (b *BinaryExpr) Cos() *FunctionExpr
Cos creates a cosine function expression
func (*BinaryExpr) Div ¶
func (b *BinaryExpr) Div(other Expr) *BinaryExpr
Div creates a division expression
func (*BinaryExpr) Floor ¶
func (b *BinaryExpr) Floor() *FunctionExpr
Floor creates a floor function expression
func (*BinaryExpr) Left ¶
func (b *BinaryExpr) Left() Expr
func (*BinaryExpr) Log ¶
func (b *BinaryExpr) Log() *FunctionExpr
Log creates a natural logarithm function expression
func (*BinaryExpr) Mul ¶
func (b *BinaryExpr) Mul(other Expr) *BinaryExpr
Mul creates a multiplication expression
func (*BinaryExpr) Op ¶
func (b *BinaryExpr) Op() BinaryOp
func (*BinaryExpr) Or ¶
func (b *BinaryExpr) Or(other Expr) *BinaryExpr
Or creates a logical OR expression
func (*BinaryExpr) Right ¶
func (b *BinaryExpr) Right() Expr
func (*BinaryExpr) Round ¶
func (b *BinaryExpr) Round() *FunctionExpr
Round creates a round function expression
func (*BinaryExpr) RoundTo ¶
func (b *BinaryExpr) RoundTo(precision Expr) *FunctionExpr
RoundTo creates a round function expression with precision
func (*BinaryExpr) Sin ¶
func (b *BinaryExpr) Sin() *FunctionExpr
Sin creates a sine function expression
func (*BinaryExpr) Sqrt ¶
func (b *BinaryExpr) Sqrt() *FunctionExpr
Sqrt creates a square root function expression
func (*BinaryExpr) String ¶
func (b *BinaryExpr) String() string
func (*BinaryExpr) Sub ¶
func (b *BinaryExpr) Sub(other Expr) *BinaryExpr
Sub creates a subtraction expression
func (*BinaryExpr) Type ¶
func (b *BinaryExpr) Type() ExprType
type CaseExpr ¶
type CaseExpr struct {
// contains filtered or unexported fields
}
CaseExpr represents a CASE expression with multiple WHEN clauses
type CaseWhen ¶
type CaseWhen struct {
// contains filtered or unexported fields
}
CaseWhen represents a condition and value pair in CASE expression
type ColumnExpr ¶
type ColumnExpr struct {
// contains filtered or unexported fields
}
ColumnExpr represents a column reference
func (*ColumnExpr) Abs ¶
func (c *ColumnExpr) Abs() *FunctionExpr
Abs creates an absolute value function expression
func (*ColumnExpr) Add ¶
func (c *ColumnExpr) Add(other Expr) *BinaryExpr
Add creates an addition expression
func (*ColumnExpr) CastToBool ¶
func (c *ColumnExpr) CastToBool() *FunctionExpr
CastToBool creates a cast to bool function expression
func (*ColumnExpr) CastToFloat64 ¶
func (c *ColumnExpr) CastToFloat64() *FunctionExpr
CastToFloat64 creates a cast to float64 function expression
func (*ColumnExpr) CastToInt64 ¶
func (c *ColumnExpr) CastToInt64() *FunctionExpr
CastToInt64 creates a cast to int64 function expression
func (*ColumnExpr) CastToString ¶
func (c *ColumnExpr) CastToString() *FunctionExpr
CastToString creates a cast to string function expression
func (*ColumnExpr) Ceil ¶
func (c *ColumnExpr) Ceil() *FunctionExpr
Ceil creates a ceil function expression
func (*ColumnExpr) Cos ¶
func (c *ColumnExpr) Cos() *FunctionExpr
Cos creates a cosine function expression
func (*ColumnExpr) Count ¶
func (c *ColumnExpr) Count() *AggregationExpr
Count creates a count aggregation of this column
func (*ColumnExpr) Div ¶
func (c *ColumnExpr) Div(other Expr) *BinaryExpr
Div creates a division expression
func (*ColumnExpr) Eq ¶
func (c *ColumnExpr) Eq(other Expr) *BinaryExpr
Eq creates an equality expression
func (*ColumnExpr) Floor ¶
func (c *ColumnExpr) Floor() *FunctionExpr
Floor creates a floor function expression
func (*ColumnExpr) Ge ¶
func (c *ColumnExpr) Ge(other Expr) *BinaryExpr
Ge creates a greater-than-or-equal expression
func (*ColumnExpr) Gt ¶
func (c *ColumnExpr) Gt(other Expr) *BinaryExpr
Gt creates a greater-than expression
func (*ColumnExpr) Le ¶
func (c *ColumnExpr) Le(other Expr) *BinaryExpr
Le creates a less-than-or-equal expression
func (*ColumnExpr) Length ¶
func (c *ColumnExpr) Length() *FunctionExpr
Length creates a LENGTH function expression
func (*ColumnExpr) Log ¶
func (c *ColumnExpr) Log() *FunctionExpr
Log creates a natural logarithm function expression
func (*ColumnExpr) Lower ¶
func (c *ColumnExpr) Lower() *FunctionExpr
Lower creates a LOWER function expression
func (*ColumnExpr) Lt ¶
func (c *ColumnExpr) Lt(other Expr) *BinaryExpr
Lt creates a less-than expression
func (*ColumnExpr) Max ¶
func (c *ColumnExpr) Max() *AggregationExpr
Max creates a max aggregation of this column
func (*ColumnExpr) Mean ¶
func (c *ColumnExpr) Mean() *AggregationExpr
Mean creates a mean aggregation of this column
func (*ColumnExpr) Min ¶
func (c *ColumnExpr) Min() *AggregationExpr
Min creates a min aggregation of this column
func (*ColumnExpr) Mul ¶
func (c *ColumnExpr) Mul(other Expr) *BinaryExpr
Mul creates a multiplication expression
func (*ColumnExpr) Name ¶
func (c *ColumnExpr) Name() string
func (*ColumnExpr) Ne ¶
func (c *ColumnExpr) Ne(other Expr) *BinaryExpr
Ne creates a not-equal expression
func (*ColumnExpr) Neg ¶
func (c *ColumnExpr) Neg() *UnaryExpr
Neg creates a negation (unary minus) expression
func (*ColumnExpr) Round ¶
func (c *ColumnExpr) Round() *FunctionExpr
Round creates a round function expression
func (*ColumnExpr) RoundTo ¶
func (c *ColumnExpr) RoundTo(precision Expr) *FunctionExpr
RoundTo creates a round function expression with precision
func (*ColumnExpr) Sin ¶
func (c *ColumnExpr) Sin() *FunctionExpr
Sin creates a sine function expression
func (*ColumnExpr) Sqrt ¶
func (c *ColumnExpr) Sqrt() *FunctionExpr
Sqrt creates a square root function expression
func (*ColumnExpr) String ¶
func (c *ColumnExpr) String() string
func (*ColumnExpr) Sub ¶
func (c *ColumnExpr) Sub(other Expr) *BinaryExpr
Sub creates a subtraction expression
func (*ColumnExpr) Substring ¶
func (c *ColumnExpr) Substring(start, length Expr) *FunctionExpr
Substring creates a SUBSTRING function expression
func (*ColumnExpr) Sum ¶
func (c *ColumnExpr) Sum() *AggregationExpr
Sum creates a sum aggregation of this column
func (*ColumnExpr) Trim ¶
func (c *ColumnExpr) Trim() *FunctionExpr
Trim creates a TRIM function expression
func (*ColumnExpr) Type ¶
func (c *ColumnExpr) Type() ExprType
func (*ColumnExpr) Upper ¶
func (c *ColumnExpr) Upper() *FunctionExpr
Upper creates an UPPER function expression
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator evaluates expressions against Arrow arrays
func NewEvaluator ¶
NewEvaluator creates a new expression evaluator
type FunctionExpr ¶
type FunctionExpr struct {
// contains filtered or unexported fields
}
FunctionExpr represents a function call expression
func Coalesce ¶
func Coalesce(exprs ...Expr) *FunctionExpr
Coalesce creates a COALESCE function expression
func If ¶
func If(condition, thenValue, elseValue Expr) *FunctionExpr
If creates an IF function expression
func (*FunctionExpr) Abs ¶
func (f *FunctionExpr) Abs() *FunctionExpr
Abs creates an absolute value function expression
func (*FunctionExpr) Add ¶
func (f *FunctionExpr) Add(other Expr) *BinaryExpr
Add creates an addition expression for function expressions
func (*FunctionExpr) And ¶
func (f *FunctionExpr) And(other Expr) *BinaryExpr
func (*FunctionExpr) Args ¶
func (f *FunctionExpr) Args() []Expr
func (*FunctionExpr) CastToBool ¶
func (f *FunctionExpr) CastToBool() *FunctionExpr
func (*FunctionExpr) CastToFloat64 ¶
func (f *FunctionExpr) CastToFloat64() *FunctionExpr
func (*FunctionExpr) CastToInt64 ¶
func (f *FunctionExpr) CastToInt64() *FunctionExpr
func (*FunctionExpr) CastToString ¶
func (f *FunctionExpr) CastToString() *FunctionExpr
CastToString creates a string casting function expression
func (*FunctionExpr) Ceil ¶
func (f *FunctionExpr) Ceil() *FunctionExpr
func (*FunctionExpr) Cos ¶
func (f *FunctionExpr) Cos() *FunctionExpr
func (*FunctionExpr) Div ¶
func (f *FunctionExpr) Div(other Expr) *BinaryExpr
func (*FunctionExpr) Eq ¶
func (f *FunctionExpr) Eq(other Expr) *BinaryExpr
func (*FunctionExpr) Floor ¶
func (f *FunctionExpr) Floor() *FunctionExpr
func (*FunctionExpr) Ge ¶
func (f *FunctionExpr) Ge(other Expr) *BinaryExpr
func (*FunctionExpr) Gt ¶
func (f *FunctionExpr) Gt(other Expr) *BinaryExpr
func (*FunctionExpr) Le ¶
func (f *FunctionExpr) Le(other Expr) *BinaryExpr
func (*FunctionExpr) Length ¶
func (f *FunctionExpr) Length() *FunctionExpr
func (*FunctionExpr) Log ¶
func (f *FunctionExpr) Log() *FunctionExpr
func (*FunctionExpr) Lower ¶
func (f *FunctionExpr) Lower() *FunctionExpr
func (*FunctionExpr) Lt ¶
func (f *FunctionExpr) Lt(other Expr) *BinaryExpr
func (*FunctionExpr) Mul ¶
func (f *FunctionExpr) Mul(other Expr) *BinaryExpr
func (*FunctionExpr) Name ¶
func (f *FunctionExpr) Name() string
func (*FunctionExpr) Ne ¶
func (f *FunctionExpr) Ne(other Expr) *BinaryExpr
func (*FunctionExpr) Neg ¶
func (f *FunctionExpr) Neg() *UnaryExpr
Neg creates a negation expression for function expressions
func (*FunctionExpr) Not ¶
func (f *FunctionExpr) Not() *UnaryExpr
func (*FunctionExpr) Or ¶
func (f *FunctionExpr) Or(other Expr) *BinaryExpr
func (*FunctionExpr) Round ¶
func (f *FunctionExpr) Round() *FunctionExpr
func (*FunctionExpr) RoundTo ¶
func (f *FunctionExpr) RoundTo(precision Expr) *FunctionExpr
func (*FunctionExpr) Sin ¶
func (f *FunctionExpr) Sin() *FunctionExpr
func (*FunctionExpr) Sqrt ¶
func (f *FunctionExpr) Sqrt() *FunctionExpr
func (*FunctionExpr) String ¶
func (f *FunctionExpr) String() string
func (*FunctionExpr) Sub ¶
func (f *FunctionExpr) Sub(other Expr) *BinaryExpr
func (*FunctionExpr) Substring ¶
func (f *FunctionExpr) Substring(start, length Expr) *FunctionExpr
func (*FunctionExpr) Trim ¶
func (f *FunctionExpr) Trim() *FunctionExpr
func (*FunctionExpr) Type ¶
func (f *FunctionExpr) Type() ExprType
func (*FunctionExpr) Upper ¶
func (f *FunctionExpr) Upper() *FunctionExpr
Upper creates an uppercase function expression
type InvalidExpr ¶
type InvalidExpr struct {
// contains filtered or unexported fields
}
InvalidExpr represents an invalid expression with an error message
func Invalid ¶
func Invalid(message string) *InvalidExpr
Invalid creates an invalid expression with an error message
func (*InvalidExpr) Message ¶
func (i *InvalidExpr) Message() string
func (*InvalidExpr) String ¶
func (i *InvalidExpr) String() string
func (*InvalidExpr) Type ¶
func (i *InvalidExpr) Type() ExprType
type LiteralExpr ¶
type LiteralExpr struct {
// contains filtered or unexported fields
}
LiteralExpr represents a literal value
func (*LiteralExpr) String ¶
func (l *LiteralExpr) String() string
func (*LiteralExpr) Type ¶
func (l *LiteralExpr) Type() ExprType
func (*LiteralExpr) Value ¶
func (l *LiteralExpr) Value() interface{}