ast

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2013 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CollateJSON

func CollateJSON(key1, key2 interface{}) int

this is N1QL collation like Couch, but strings are compared like memcmp

func DisableDeveloperFunctions

func DisableDeveloperFunctions()

func EnableDeveloperFunctions

func EnableDeveloperFunctions()

func RoundFloat

func RoundFloat(x float64, prec int) float64

func TruncateFloat

func TruncateFloat(x float64, prec int) float64

func ValueInBooleanContext

func ValueInBooleanContext(val interface{}) interface{}

this function is repsonible for determining if a value should be considered true or false in a boolean context NOTE: this is my first attempt at making this behave consisten with javascript SEE http://ecma-international.org/ecma-262/5.1/#sec-9.2

Types

type AggregateFunctionCall

type AggregateFunctionCall struct {
	FunctionCall
}

func (AggregateFunctionCall) Key

func (this AggregateFunctionCall) Key() string

create a unique key where the current value for this aggregate function will be stored

type AggregateFunctionCallExpression

type AggregateFunctionCallExpression interface {
	FunctionCallExpression
	UpdateAggregate(group *dparval.Value, item *dparval.Value) error
	DefaultAggregate(group *dparval.Value) error
	Key() string
}

type AndOperator

type AndOperator struct {
	Type string `json:"type"`
	NaryOperator
}

func NewAndOperator

func NewAndOperator(operands ExpressionList) *AndOperator

func (*AndOperator) Accept

func (this *AndOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*AndOperator) Copy added in v0.6.0

func (this *AndOperator) Copy() Expression

func (*AndOperator) Evaluate

func (this *AndOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type BinaryOperator

type BinaryOperator struct {
	Left  Expression `json:"left"`
	Right Expression `json:"right"`
	// contains filtered or unexported fields
}

func (*BinaryOperator) Dependencies

func (this *BinaryOperator) Dependencies() ExpressionList

func (*BinaryOperator) EquivalentTo

func (this *BinaryOperator) EquivalentTo(t Expression) bool

func (*BinaryOperator) EvaluateBoth

func (this *BinaryOperator) EvaluateBoth(context *dparval.Value) (*dparval.Value, *dparval.Value, error)

func (*BinaryOperator) EvaluateBothRequireNumber

func (this *BinaryOperator) EvaluateBothRequireNumber(context *dparval.Value) (float64, float64, bool, error)

func (*BinaryOperator) EvaluateBothRequireString

func (this *BinaryOperator) EvaluateBothRequireString(context *dparval.Value) (string, string, bool, error)

func (*BinaryOperator) GetLeft

func (this *BinaryOperator) GetLeft() Expression

func (*BinaryOperator) GetRight

func (this *BinaryOperator) GetRight() Expression

func (*BinaryOperator) Operator

func (this *BinaryOperator) Operator() string

func (*BinaryOperator) SetLeft

func (this *BinaryOperator) SetLeft(left Expression)

func (*BinaryOperator) SetRight

func (this *BinaryOperator) SetRight(right Expression)

func (*BinaryOperator) String

func (this *BinaryOperator) String() string

type BinaryOperatorExpression

type BinaryOperatorExpression interface {
	OperatorExpression
	GetLeft() Expression
	GetRight() Expression
	SetLeft(Expression)
	SetRight(Expression)
}

type BracketMemberOperator

type BracketMemberOperator struct {
	Type  string     `json:"type"`
	Left  Expression `json:"left"`
	Right Expression `json:"right"`
}

func NewBracketMemberOperator

func NewBracketMemberOperator(left, right Expression) *BracketMemberOperator

func (*BracketMemberOperator) Accept

func (*BracketMemberOperator) Copy added in v0.6.0

func (this *BracketMemberOperator) Copy() Expression

func (*BracketMemberOperator) Dependencies

func (this *BracketMemberOperator) Dependencies() ExpressionList

func (*BracketMemberOperator) EquivalentTo

func (this *BracketMemberOperator) EquivalentTo(t Expression) bool

func (*BracketMemberOperator) Evaluate

func (this *BracketMemberOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*BracketMemberOperator) String

func (this *BracketMemberOperator) String() string

func (*BracketMemberOperator) UnmarshalJSON

func (this *BracketMemberOperator) UnmarshalJSON(data []byte) error

type CaseOperator

type CaseOperator struct {
	Type      string      `json:"type"`
	WhenThens []*WhenThen `json:"whenthens"`
	Else      Expression  `json:"else"`
}

func NewCaseOperator

func NewCaseOperator() *CaseOperator

func (*CaseOperator) Accept

func (this *CaseOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*CaseOperator) Copy added in v0.6.0

func (this *CaseOperator) Copy() Expression

func (*CaseOperator) Dependencies

func (this *CaseOperator) Dependencies() ExpressionList

func (*CaseOperator) EquivalentTo

func (this *CaseOperator) EquivalentTo(t Expression) bool

func (*CaseOperator) Evaluate

func (this *CaseOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*CaseOperator) String

func (this *CaseOperator) String() string

type ChangeSignOperator

type ChangeSignOperator struct {
	Type string `json:"type"`
	PrefixUnaryOperator
}

func NewChangeSignOperator

func NewChangeSignOperator(operand Expression) *ChangeSignOperator

func (*ChangeSignOperator) Accept

func (*ChangeSignOperator) Copy added in v0.6.0

func (this *ChangeSignOperator) Copy() Expression

func (*ChangeSignOperator) Evaluate

func (this *ChangeSignOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type CollectionAllOperator

type CollectionAllOperator struct {
	Type string `json:"type"`
	CollectionOperator
}

func NewCollectionAllOperator

func NewCollectionAllOperator(condition Expression, over Expression, as string) *CollectionAllOperator

func (*CollectionAllOperator) Accept

func (*CollectionAllOperator) Copy added in v0.6.0

func (this *CollectionAllOperator) Copy() Expression

func (*CollectionAllOperator) Evaluate

func (this *CollectionAllOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type CollectionAnyOperator

type CollectionAnyOperator struct {
	Type string `json:"type"`
	CollectionOperator
}

func NewCollectionAnyOperator

func NewCollectionAnyOperator(condition Expression, over Expression, as string) *CollectionAnyOperator

func (*CollectionAnyOperator) Accept

func (*CollectionAnyOperator) Copy added in v0.6.0

func (this *CollectionAnyOperator) Copy() Expression

func (*CollectionAnyOperator) Evaluate

func (this *CollectionAnyOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type CollectionArrayOperator

type CollectionArrayOperator struct {
	Type string `json:"type"`
	CollectionOperator
}

func NewCollectionArrayOperator

func NewCollectionArrayOperator(condition Expression, over Expression, as string, output Expression) *CollectionArrayOperator

func (*CollectionArrayOperator) Accept

func (*CollectionArrayOperator) Copy added in v0.6.0

func (this *CollectionArrayOperator) Copy() Expression

func (*CollectionArrayOperator) Evaluate

func (this *CollectionArrayOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type CollectionFirstOperator

type CollectionFirstOperator struct {
	Type string `json:"type"`
	CollectionOperator
}

func NewCollectionFirstOperator

func NewCollectionFirstOperator(condition Expression, over Expression, as string, output Expression) *CollectionFirstOperator

func (*CollectionFirstOperator) Accept

func (*CollectionFirstOperator) Copy added in v0.6.0

func (this *CollectionFirstOperator) Copy() Expression

func (*CollectionFirstOperator) Evaluate

func (this *CollectionFirstOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type CollectionOperator

type CollectionOperator struct {
	Condition Expression `json:"condition"`
	Over      Expression `json:"over"`
	As        string     `json:"as"`
	Output    Expression `json:"output"`
	// contains filtered or unexported fields
}

func (*CollectionOperator) Dependencies

func (this *CollectionOperator) Dependencies() ExpressionList

func (*CollectionOperator) EquivalentTo

func (this *CollectionOperator) EquivalentTo(t Expression) bool

func (*CollectionOperator) GetAs

func (this *CollectionOperator) GetAs() string

func (*CollectionOperator) GetCondition

func (this *CollectionOperator) GetCondition() Expression

func (*CollectionOperator) GetOutput

func (this *CollectionOperator) GetOutput() Expression

func (*CollectionOperator) GetOver

func (this *CollectionOperator) GetOver() Expression

func (*CollectionOperator) Operator

func (this *CollectionOperator) Operator() string

func (*CollectionOperator) SetAs

func (this *CollectionOperator) SetAs(as string)

func (*CollectionOperator) SetCondition

func (this *CollectionOperator) SetCondition(condition Expression)

func (*CollectionOperator) SetOutput

func (this *CollectionOperator) SetOutput(output Expression)

func (*CollectionOperator) SetOver

func (this *CollectionOperator) SetOver(over Expression)

func (*CollectionOperator) String

func (this *CollectionOperator) String() string

type CollectionOperatorExpression

type CollectionOperatorExpression interface {
	OperatorExpression
	GetOver() Expression
	GetCondition() Expression
	GetAs() string
	SetOver(Expression)
	SetCondition(Expression)
	SetAs(string)
	GetOutput() Expression
	SetOutput(Expression)
}

type CommutativeBinaryOperator

type CommutativeBinaryOperator struct {
	BinaryOperator
}

func (*CommutativeBinaryOperator) EquivalentTo

func (this *CommutativeBinaryOperator) EquivalentTo(t Expression) bool

type CreateIndexStatement

type CreateIndexStatement struct {
	Method      string         `json:"method"`
	Name        string         `json:"name"`
	ExplainOnly bool           `json:"explain"`
	Bucket      string         `json:"bucket"`
	Pool        string         `json:"pool"`
	On          ExpressionList `json:"on"`
	Primary     bool           `json:"primary"`
}

func NewCreateIndexStatement

func NewCreateIndexStatement() *CreateIndexStatement

func (*CreateIndexStatement) IsExplainOnly

func (this *CreateIndexStatement) IsExplainOnly() bool

func (*CreateIndexStatement) SetExplainOnly

func (this *CreateIndexStatement) SetExplainOnly(only bool)

func (*CreateIndexStatement) Simplify

func (this *CreateIndexStatement) Simplify() error

func (*CreateIndexStatement) VerifySemantics

func (this *CreateIndexStatement) VerifySemantics() error

type DivideOperator

type DivideOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewDivideOperator

func NewDivideOperator(left, right Expression) *DivideOperator

func (*DivideOperator) Accept

func (this *DivideOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*DivideOperator) Copy added in v0.6.0

func (this *DivideOperator) Copy() Expression

func (*DivideOperator) Evaluate

func (this *DivideOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type DotMemberOperator

type DotMemberOperator struct {
	Type  string     `json:"type"`
	Left  Expression `json:"left"`
	Right *Property  `json:"right"`
}

func NewDotMemberOperator

func NewDotMemberOperator(left Expression, right *Property) *DotMemberOperator

func (*DotMemberOperator) Accept

func (*DotMemberOperator) Copy added in v0.6.0

func (this *DotMemberOperator) Copy() Expression

func (*DotMemberOperator) Dependencies

func (this *DotMemberOperator) Dependencies() ExpressionList

sliglty confusingly, a dot-member expression does not actually depend on its RHS a.b could be rewritten as a["b"] and since b is literal string it is not a dependency other way to look at it is that we're looking side what the LHS gave us, not the outer context, so we don't depend on the outside world at all

func (*DotMemberOperator) EquivalentTo

func (this *DotMemberOperator) EquivalentTo(t Expression) bool

func (*DotMemberOperator) Evaluate

func (this *DotMemberOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*DotMemberOperator) String

func (this *DotMemberOperator) String() string

func (*DotMemberOperator) UnmarshalJSON

func (this *DotMemberOperator) UnmarshalJSON(data []byte) error

type DropIndexStatement

type DropIndexStatement struct {
	Name        string `json:"name"`
	ExplainOnly bool   `json:"explain"`
	Bucket      string `json:"bucket"`
	Pool        string `json:"pool"`
}

func NewDropIndexStatement

func NewDropIndexStatement() *DropIndexStatement

func (*DropIndexStatement) IsExplainOnly

func (this *DropIndexStatement) IsExplainOnly() bool

func (*DropIndexStatement) SetExplainOnly

func (this *DropIndexStatement) SetExplainOnly(only bool)

func (*DropIndexStatement) Simplify

func (this *DropIndexStatement) Simplify() error

func (*DropIndexStatement) VerifySemantics

func (this *DropIndexStatement) VerifySemantics() error

type DuplicateAlias

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

func (*DuplicateAlias) Error

func (this *DuplicateAlias) Error() string

type EqualToOperator

type EqualToOperator struct {
	Type string `json:"type"`
	CommutativeBinaryOperator
}

func NewEqualToOperator

func NewEqualToOperator(left, right Expression) *EqualToOperator

func (*EqualToOperator) Accept

func (this *EqualToOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*EqualToOperator) Copy added in v0.6.0

func (this *EqualToOperator) Copy() Expression

func (*EqualToOperator) Evaluate

func (this *EqualToOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type Expression

type Expression interface {
	fmt.Stringer

	Evaluate(item *dparval.Value) (*dparval.Value, error)

	// Is this Expresion equivalent to that Expression?
	EquivalentTo(Expression) bool

	// A list of other Expressions up on which this depends
	Dependencies() ExpressionList

	// Vistor Pattern
	Accept(ExpressionVisitor) (Expression, error)

	// Return a complete copy of yourself
	Copy() Expression
}

func UnmarshalExpression

func UnmarshalExpression(bytes []byte) (Expression, error)

func VisitChildren

func VisitChildren(v ExpressionVisitor, e Expression) (Expression, error)

a utility function giving the default behavior of visiting a nodes children

type ExpressionAggregateFinder

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

this ExpressionVisitor searches the expression for any aggregate function calls embedded inside so that the appropriate calculations can be made during the grouping phase

func NewExpressionAggregateFinder

func NewExpressionAggregateFinder() *ExpressionAggregateFinder

func (*ExpressionAggregateFinder) GetAggregates

func (this *ExpressionAggregateFinder) GetAggregates() ExpressionList

func (*ExpressionAggregateFinder) Visit

type ExpressionCNF

type ExpressionCNF struct {
}

convert an expresion to Negation Normal Form http://en.wikipedia.org/wiki/Negation_normal_form

func NewExpressionCNF

func NewExpressionCNF() *ExpressionCNF

func (*ExpressionCNF) Visit

func (this *ExpressionCNF) Visit(e Expression) (Expression, error)

type ExpressionEquivalenceChecker

type ExpressionEquivalenceChecker struct {
	Expressions ExpressionList
}

this ExpressionVisitor will determine if the given expression can be satisfied by the specified dependencies, or if it instead has other dependencies

func NewExpressionEquivalenceChecker

func NewExpressionEquivalenceChecker(exprs ExpressionList) *ExpressionEquivalenceChecker

func (*ExpressionEquivalenceChecker) Visit

type ExpressionFormalNotationConverter

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

func NewExpressionFormalNotationConverter

func NewExpressionFormalNotationConverter(forbiddenAliases []string, aliases []string, defaultAlias string) *ExpressionFormalNotationConverter

this visitor takes a list of valid aliases if there are any forbidden Aliases all property refereces MUST NOT start with one of these aliases if there is more than 1 alias in the list all property references MUST start with one of these aliases if not, an appropriate error is returned if there is only 1 alias, and the reference can be converted a new expression with the proper reference is returned it is up to the caller to update any references it may have

func (*ExpressionFormalNotationConverter) Visit

func (*ExpressionFormalNotationConverter) VisitCollectionChild

func (this *ExpressionFormalNotationConverter) VisitCollectionChild(expr CollectionOperatorExpression) error

func (*ExpressionFormalNotationConverter) VisitDotMemberChild

func (this *ExpressionFormalNotationConverter) VisitDotMemberChild(expr *DotMemberOperator) (Expression, error)

func (*ExpressionFormalNotationConverter) VisitFunctionCall

func (this *ExpressionFormalNotationConverter) VisitFunctionCall(expr FunctionCallExpression) error

func (*ExpressionFormalNotationConverter) VisitProperty

func (this *ExpressionFormalNotationConverter) VisitProperty(expr *Property) (Expression, error)

type ExpressionFunctionalDependencyChecker

type ExpressionFunctionalDependencyChecker struct {
	Dependencies        ExpressionList
	AggregatesSatisfied bool
}

this ExpressionVisitor will determine if the given expression can be satisfied by the specified dependencies, or if it instead has other dependencies

func NewExpressionFunctionalDependencyChecker

func NewExpressionFunctionalDependencyChecker(deps ExpressionList) *ExpressionFunctionalDependencyChecker

func NewExpressionFunctionalDependencyCheckerFull

func NewExpressionFunctionalDependencyCheckerFull(deps ExpressionList) *ExpressionFunctionalDependencyChecker

func (*ExpressionFunctionalDependencyChecker) Visit

type ExpressionList

type ExpressionList []Expression

func (ExpressionList) EquivalentTo

func (this ExpressionList) EquivalentTo(e Expression) Expression

func (ExpressionList) Simplify

func (this ExpressionList) Simplify() error

func (ExpressionList) Validate

func (this ExpressionList) Validate() error

func (ExpressionList) VerifyFormalNotation

func (this ExpressionList) VerifyFormalNotation(forbiddenAliases []string, aliases []string, defaultAlias string) error

type ExpressionNNF

type ExpressionNNF struct {
}

convert an expresion to Negation Normal Form http://en.wikipedia.org/wiki/Negation_normal_form

func NewExpressionNNF

func NewExpressionNNF() *ExpressionNNF

func (*ExpressionNNF) Visit

func (this *ExpressionNNF) Visit(e Expression) (Expression, error)

type ExpressionSimplifier

type ExpressionSimplifier struct {
}

func NewExpressionSimplifier

func NewExpressionSimplifier() *ExpressionSimplifier

func (*ExpressionSimplifier) Visit

func (this *ExpressionSimplifier) Visit(e Expression) (Expression, error)

type ExpressionValidator

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

func NewExpressionValidator

func NewExpressionValidator() *ExpressionValidator

func NewExpressionValidatorNoAggregates

func NewExpressionValidatorNoAggregates() *ExpressionValidator

func (*ExpressionValidator) ValidateFunctionCall

func (this *ExpressionValidator) ValidateFunctionCall(expr FunctionCallExpression) error

func (*ExpressionValidator) Visit

func (this *ExpressionValidator) Visit(e Expression) (Expression, error)

type ExpressionVisitor

type ExpressionVisitor interface {
	Visit(Expression) (Expression, error)
}

type From

type From struct {
	Pool       string
	Bucket     string
	Projection Expression
	As         string
	Over       *From
}

func (*From) ConvertToBucketFrom

func (this *From) ConvertToBucketFrom()

FROM is a generic structure capturing both top-level FROMs and OVER constructs in top level FROMs the start of the Projection path is the bucket name this should be set correct and also removed from the Projection for example: FROM person.friends OVER contacts AS contact the top-level FROM should have bucket "person" and projection "friends" the second level FROM has no bucket and projection "contacts"

func (*From) GenerateAlias

func (this *From) GenerateAlias()

func (*From) GetAliases

func (this *From) GetAliases() []string

type FunctionArgExpression

type FunctionArgExpression struct {
	Star bool       `json:"star"`
	Expr Expression `json:"expr"`
}

func NewDotStarFunctionArgExpression

func NewDotStarFunctionArgExpression(expr Expression) *FunctionArgExpression

func NewFunctionArgExpression

func NewFunctionArgExpression(expr Expression) *FunctionArgExpression

func NewStarFunctionArgExpression

func NewStarFunctionArgExpression() *FunctionArgExpression

func (*FunctionArgExpression) Copy added in v0.6.0

func (*FunctionArgExpression) EquivalentTo

func (this *FunctionArgExpression) EquivalentTo(that *FunctionArgExpression) bool

func (*FunctionArgExpression) String

func (this *FunctionArgExpression) String() string

type FunctionArgExpressionList

type FunctionArgExpressionList []*FunctionArgExpression

func (FunctionArgExpressionList) Copy added in v0.6.0

func (FunctionArgExpressionList) String

func (this FunctionArgExpressionList) String() string

type FunctionCall

type FunctionCall struct {
	Type     string                    `json:"type"`
	Name     string                    `json:"name"`
	Operands FunctionArgExpressionList `json:"operands"`
	Distinct bool                      `json:"distinct"`
	// contains filtered or unexported fields
}

func (*FunctionCall) Dependencies

func (this *FunctionCall) Dependencies() ExpressionList

func (*FunctionCall) EquivalentTo

func (this *FunctionCall) EquivalentTo(t Expression) bool

func (*FunctionCall) GetName

func (this *FunctionCall) GetName() string

func (*FunctionCall) GetOperands

func (this *FunctionCall) GetOperands() FunctionArgExpressionList

func (*FunctionCall) IsDistinct

func (this *FunctionCall) IsDistinct() bool

func (*FunctionCall) SetDistinct

func (this *FunctionCall) SetDistinct(distinct bool)

func (*FunctionCall) SetOperands

func (this *FunctionCall) SetOperands(operands FunctionArgExpressionList)

func (*FunctionCall) String

func (this *FunctionCall) String() string

func (*FunctionCall) ValidateArity

func (this *FunctionCall) ValidateArity() error

func (*FunctionCall) ValidateDistinct

func (this *FunctionCall) ValidateDistinct() error

func (*FunctionCall) ValidateStars

func (this *FunctionCall) ValidateStars() error

type FunctionCallArrayAgg

type FunctionCallArrayAgg struct {
	AggregateFunctionCall
}

func (*FunctionCallArrayAgg) Accept

func (*FunctionCallArrayAgg) Copy added in v0.6.0

func (this *FunctionCallArrayAgg) Copy() Expression

func (*FunctionCallArrayAgg) DefaultAggregate

func (this *FunctionCallArrayAgg) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallArrayAgg) Evaluate

func (this *FunctionCallArrayAgg) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallArrayAgg) UpdateAggregate

func (this *FunctionCallArrayAgg) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallAvg

type FunctionCallAvg struct {
	AggregateFunctionCall
}

func (*FunctionCallAvg) Accept

func (this *FunctionCallAvg) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallAvg) Copy added in v0.6.0

func (this *FunctionCallAvg) Copy() Expression

func (*FunctionCallAvg) DefaultAggregate

func (this *FunctionCallAvg) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallAvg) Evaluate

func (this *FunctionCallAvg) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallAvg) UpdateAggregate

func (this *FunctionCallAvg) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallBase64Value

type FunctionCallBase64Value struct {
	FunctionCall
}

func (*FunctionCallBase64Value) Accept

func (*FunctionCallBase64Value) Copy added in v0.6.0

func (this *FunctionCallBase64Value) Copy() Expression

func (*FunctionCallBase64Value) Evaluate

func (this *FunctionCallBase64Value) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallCeil

type FunctionCallCeil struct {
	FunctionCall
}

func (*FunctionCallCeil) Accept

func (this *FunctionCallCeil) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallCeil) Copy added in v0.6.0

func (this *FunctionCallCeil) Copy() Expression

func (*FunctionCallCeil) Evaluate

func (this *FunctionCallCeil) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallConstructor

type FunctionCallConstructor func(operands FunctionArgExpressionList) FunctionCallExpression

type FunctionCallCount

type FunctionCallCount struct {
	AggregateFunctionCall
}

func (*FunctionCallCount) Accept

func (*FunctionCallCount) Copy added in v0.6.0

func (this *FunctionCallCount) Copy() Expression

func (*FunctionCallCount) DefaultAggregate

func (this *FunctionCallCount) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallCount) Evaluate

func (this *FunctionCallCount) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallCount) UpdateAggregate

func (this *FunctionCallCount) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallDatePart added in v0.6.0

type FunctionCallDatePart struct {
	FunctionCall
}

func (*FunctionCallDatePart) Accept added in v0.6.0

func (*FunctionCallDatePart) Copy added in v0.6.0

func (this *FunctionCallDatePart) Copy() Expression

func (*FunctionCallDatePart) Evaluate added in v0.6.0

func (this *FunctionCallDatePart) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallDisableLog

type FunctionCallDisableLog struct {
	FunctionCall
}

func (*FunctionCallDisableLog) Accept

func (*FunctionCallDisableLog) Copy added in v0.6.0

func (this *FunctionCallDisableLog) Copy() Expression

func (*FunctionCallDisableLog) Evaluate

func (this *FunctionCallDisableLog) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallEnableLog

type FunctionCallEnableLog struct {
	FunctionCall
}

func (*FunctionCallEnableLog) Accept

func (*FunctionCallEnableLog) Copy added in v0.6.0

func (this *FunctionCallEnableLog) Copy() Expression

func (*FunctionCallEnableLog) Evaluate

func (this *FunctionCallEnableLog) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallError

type FunctionCallError struct {
	FunctionCall
}

func (*FunctionCallError) Accept

func (*FunctionCallError) Copy added in v0.6.0

func (this *FunctionCallError) Copy() Expression

func (*FunctionCallError) Evaluate

func (this *FunctionCallError) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallExpression

type FunctionCallExpression interface {
	Expression
	GetName() string
	GetOperands() FunctionArgExpressionList
	SetOperands(FunctionArgExpressionList)
	ValidateArity() error
	ValidateStars() error
	ValidateDistinct() error
	IsDistinct() bool
	SetDistinct(bool)
}

func NewFunctionCall

func NewFunctionCall(name string, operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallArrayAgg

func NewFunctionCallArrayAgg(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallBase64Value

func NewFunctionCallBase64Value(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallCount

func NewFunctionCallCount(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallDatePart added in v0.6.0

func NewFunctionCallDatePart(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallDisableLog

func NewFunctionCallDisableLog(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallEnableLog

func NewFunctionCallEnableLog(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallError

func NewFunctionCallError(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallFirstNum

func NewFunctionCallFirstNum(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallFloor

func NewFunctionCallFloor(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallGreatest

func NewFunctionCallGreatest(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfInf

func NewFunctionCallIfInf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfMissing

func NewFunctionCallIfMissing(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfMissingOrNull

func NewFunctionCallIfMissingOrNull(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfNaN

func NewFunctionCallIfNaN(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfNaNOrInf

func NewFunctionCallIfNaNOrInf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfNegInf

func NewFunctionCallIfNegInf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfNull

func NewFunctionCallIfNull(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallIfPosInf

func NewFunctionCallIfPosInf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallLTrim

func NewFunctionCallLTrim(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallLeast

func NewFunctionCallLeast(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallLength

func NewFunctionCallLength(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallLower

func NewFunctionCallLower(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallMissingIf

func NewFunctionCallMissingIf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallNaNIf

func NewFunctionCallNaNIf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallNegInfIf

func NewFunctionCallNegInfIf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallNowStr added in v0.6.0

func NewFunctionCallNowStr(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallNullIf

func NewFunctionCallNullIf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallPanic

func NewFunctionCallPanic(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallPosInfIf

func NewFunctionCallPosInfIf(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallRTrim

func NewFunctionCallRTrim(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallRound

func NewFunctionCallRound(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallSubStr

func NewFunctionCallSubStr(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallTrunc

func NewFunctionCallTrunc(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallUnknown

func NewFunctionCallUnknown(operands FunctionArgExpressionList, name string) FunctionCallExpression

func NewFunctionCallUpper

func NewFunctionCallUpper(operands FunctionArgExpressionList) FunctionCallExpression

func NewFunctionCallValue

func NewFunctionCallValue(operands FunctionArgExpressionList) FunctionCallExpression

type FunctionCallFirstNum

type FunctionCallFirstNum struct {
	FunctionCall
}

func (*FunctionCallFirstNum) Accept

func (*FunctionCallFirstNum) Copy added in v0.6.0

func (this *FunctionCallFirstNum) Copy() Expression

func (*FunctionCallFirstNum) Evaluate

func (this *FunctionCallFirstNum) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallFloor

type FunctionCallFloor struct {
	FunctionCall
}

func (*FunctionCallFloor) Accept

func (*FunctionCallFloor) Copy added in v0.6.0

func (this *FunctionCallFloor) Copy() Expression

func (*FunctionCallFloor) Evaluate

func (this *FunctionCallFloor) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallGreatest

type FunctionCallGreatest struct {
	FunctionCall
}

func (*FunctionCallGreatest) Accept

func (*FunctionCallGreatest) Copy added in v0.6.0

func (this *FunctionCallGreatest) Copy() Expression

func (*FunctionCallGreatest) Evaluate

func (this *FunctionCallGreatest) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfInf

type FunctionCallIfInf struct {
	FunctionCall
}

func (*FunctionCallIfInf) Accept

func (*FunctionCallIfInf) Copy added in v0.6.0

func (this *FunctionCallIfInf) Copy() Expression

func (*FunctionCallIfInf) Evaluate

func (this *FunctionCallIfInf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfMissing

type FunctionCallIfMissing struct {
	FunctionCall
}

func (*FunctionCallIfMissing) Accept

func (*FunctionCallIfMissing) Copy added in v0.6.0

func (this *FunctionCallIfMissing) Copy() Expression

func (*FunctionCallIfMissing) Evaluate

func (this *FunctionCallIfMissing) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfMissingOrNull

type FunctionCallIfMissingOrNull struct {
	FunctionCall
}

func (*FunctionCallIfMissingOrNull) Accept

func (*FunctionCallIfMissingOrNull) Copy added in v0.6.0

func (*FunctionCallIfMissingOrNull) Evaluate

func (this *FunctionCallIfMissingOrNull) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfNaN

type FunctionCallIfNaN struct {
	FunctionCall
}

func (*FunctionCallIfNaN) Accept

func (*FunctionCallIfNaN) Copy added in v0.6.0

func (this *FunctionCallIfNaN) Copy() Expression

func (*FunctionCallIfNaN) Evaluate

func (this *FunctionCallIfNaN) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfNaNOrInf

type FunctionCallIfNaNOrInf struct {
	FunctionCall
}

func (*FunctionCallIfNaNOrInf) Accept

func (*FunctionCallIfNaNOrInf) Copy added in v0.6.0

func (this *FunctionCallIfNaNOrInf) Copy() Expression

func (*FunctionCallIfNaNOrInf) Evaluate

func (this *FunctionCallIfNaNOrInf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfNegInf

type FunctionCallIfNegInf struct {
	FunctionCall
}

func (*FunctionCallIfNegInf) Accept

func (*FunctionCallIfNegInf) Copy added in v0.6.0

func (this *FunctionCallIfNegInf) Copy() Expression

func (*FunctionCallIfNegInf) Evaluate

func (this *FunctionCallIfNegInf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfNull

type FunctionCallIfNull struct {
	FunctionCall
}

func (*FunctionCallIfNull) Accept

func (*FunctionCallIfNull) Copy added in v0.6.0

func (this *FunctionCallIfNull) Copy() Expression

func (*FunctionCallIfNull) Evaluate

func (this *FunctionCallIfNull) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallIfPosInf

type FunctionCallIfPosInf struct {
	FunctionCall
}

func (*FunctionCallIfPosInf) Accept

func (*FunctionCallIfPosInf) Copy added in v0.6.0

func (this *FunctionCallIfPosInf) Copy() Expression

func (*FunctionCallIfPosInf) Evaluate

func (this *FunctionCallIfPosInf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallLTrim

type FunctionCallLTrim struct {
	FunctionCall
}

func (*FunctionCallLTrim) Accept

func (*FunctionCallLTrim) Copy added in v0.6.0

func (this *FunctionCallLTrim) Copy() Expression

func (*FunctionCallLTrim) Evaluate

func (this *FunctionCallLTrim) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallLeast

type FunctionCallLeast struct {
	FunctionCall
}

func (*FunctionCallLeast) Accept

func (*FunctionCallLeast) Copy added in v0.6.0

func (this *FunctionCallLeast) Copy() Expression

func (*FunctionCallLeast) Evaluate

func (this *FunctionCallLeast) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallLength

type FunctionCallLength struct {
	FunctionCall
}

func (*FunctionCallLength) Accept

func (*FunctionCallLength) Copy added in v0.6.0

func (this *FunctionCallLength) Copy() Expression

func (*FunctionCallLength) Evaluate

func (this *FunctionCallLength) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallLower

type FunctionCallLower struct {
	FunctionCall
}

func (*FunctionCallLower) Accept

func (*FunctionCallLower) Copy added in v0.6.0

func (this *FunctionCallLower) Copy() Expression

func (*FunctionCallLower) Evaluate

func (this *FunctionCallLower) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallMax

type FunctionCallMax struct {
	AggregateFunctionCall
}

func (*FunctionCallMax) Accept

func (this *FunctionCallMax) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallMax) Copy added in v0.6.0

func (this *FunctionCallMax) Copy() Expression

func (*FunctionCallMax) DefaultAggregate

func (this *FunctionCallMax) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallMax) Evaluate

func (this *FunctionCallMax) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallMax) UpdateAggregate

func (this *FunctionCallMax) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallMeta

type FunctionCallMeta struct {
	FunctionCall
}

func (*FunctionCallMeta) Accept

func (this *FunctionCallMeta) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallMeta) Copy added in v0.6.0

func (this *FunctionCallMeta) Copy() Expression

func (*FunctionCallMeta) Evaluate

func (this *FunctionCallMeta) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallMin

type FunctionCallMin struct {
	AggregateFunctionCall
}

func (*FunctionCallMin) Accept

func (this *FunctionCallMin) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallMin) Copy added in v0.6.0

func (this *FunctionCallMin) Copy() Expression

func (*FunctionCallMin) DefaultAggregate

func (this *FunctionCallMin) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallMin) Evaluate

func (this *FunctionCallMin) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallMin) UpdateAggregate

func (this *FunctionCallMin) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallMissingIf

type FunctionCallMissingIf struct {
	FunctionCall
}

func (*FunctionCallMissingIf) Accept

func (*FunctionCallMissingIf) Copy added in v0.6.0

func (this *FunctionCallMissingIf) Copy() Expression

func (*FunctionCallMissingIf) Evaluate

func (this *FunctionCallMissingIf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallNaNIf

type FunctionCallNaNIf struct {
	FunctionCall
}

func (*FunctionCallNaNIf) Accept

func (*FunctionCallNaNIf) Copy added in v0.6.0

func (this *FunctionCallNaNIf) Copy() Expression

func (*FunctionCallNaNIf) Evaluate

func (this *FunctionCallNaNIf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallNegInfIf

type FunctionCallNegInfIf struct {
	FunctionCall
}

func (*FunctionCallNegInfIf) Accept

func (*FunctionCallNegInfIf) Copy added in v0.6.0

func (this *FunctionCallNegInfIf) Copy() Expression

func (*FunctionCallNegInfIf) Evaluate

func (this *FunctionCallNegInfIf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallNowStr added in v0.6.0

type FunctionCallNowStr struct {
	FunctionCall
}

func (*FunctionCallNowStr) Accept added in v0.6.0

func (*FunctionCallNowStr) Copy added in v0.6.0

func (this *FunctionCallNowStr) Copy() Expression

func (*FunctionCallNowStr) Evaluate added in v0.6.0

func (this *FunctionCallNowStr) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallNullIf

type FunctionCallNullIf struct {
	FunctionCall
}

func (*FunctionCallNullIf) Accept

func (*FunctionCallNullIf) Copy added in v0.6.0

func (this *FunctionCallNullIf) Copy() Expression

func (*FunctionCallNullIf) Evaluate

func (this *FunctionCallNullIf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallPanic

type FunctionCallPanic struct {
	FunctionCall
}

func (*FunctionCallPanic) Accept

func (*FunctionCallPanic) Copy added in v0.6.0

func (this *FunctionCallPanic) Copy() Expression

func (*FunctionCallPanic) Evaluate

func (this *FunctionCallPanic) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallPosInfIf

type FunctionCallPosInfIf struct {
	FunctionCall
}

func (*FunctionCallPosInfIf) Accept

func (*FunctionCallPosInfIf) Copy added in v0.6.0

func (this *FunctionCallPosInfIf) Copy() Expression

func (*FunctionCallPosInfIf) Evaluate

func (this *FunctionCallPosInfIf) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallRTrim

type FunctionCallRTrim struct {
	FunctionCall
}

func (*FunctionCallRTrim) Accept

func (*FunctionCallRTrim) Copy added in v0.6.0

func (this *FunctionCallRTrim) Copy() Expression

func (*FunctionCallRTrim) Evaluate

func (this *FunctionCallRTrim) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallRound

type FunctionCallRound struct {
	FunctionCall
}

func (*FunctionCallRound) Accept

func (*FunctionCallRound) Copy added in v0.6.0

func (this *FunctionCallRound) Copy() Expression

func (*FunctionCallRound) Evaluate

func (this *FunctionCallRound) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallSubStr

type FunctionCallSubStr struct {
	FunctionCall
}

func (*FunctionCallSubStr) Accept

func (*FunctionCallSubStr) Copy added in v0.6.0

func (this *FunctionCallSubStr) Copy() Expression

func (*FunctionCallSubStr) Evaluate

func (this *FunctionCallSubStr) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallSum

type FunctionCallSum struct {
	AggregateFunctionCall
}

func (*FunctionCallSum) Accept

func (this *FunctionCallSum) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallSum) Copy added in v0.6.0

func (this *FunctionCallSum) Copy() Expression

func (*FunctionCallSum) DefaultAggregate

func (this *FunctionCallSum) DefaultAggregate(group *dparval.Value) error

func (*FunctionCallSum) Evaluate

func (this *FunctionCallSum) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*FunctionCallSum) UpdateAggregate

func (this *FunctionCallSum) UpdateAggregate(group *dparval.Value, item *dparval.Value) error

type FunctionCallTrim

type FunctionCallTrim struct {
	FunctionCall
}

func (*FunctionCallTrim) Accept

func (this *FunctionCallTrim) Accept(ev ExpressionVisitor) (Expression, error)

func (*FunctionCallTrim) Copy added in v0.6.0

func (this *FunctionCallTrim) Copy() Expression

func (*FunctionCallTrim) Evaluate

func (this *FunctionCallTrim) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallTrunc

type FunctionCallTrunc struct {
	FunctionCall
}

func (*FunctionCallTrunc) Accept

func (*FunctionCallTrunc) Copy added in v0.6.0

func (this *FunctionCallTrunc) Copy() Expression

func (*FunctionCallTrunc) Evaluate

func (this *FunctionCallTrunc) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallUnknown

type FunctionCallUnknown struct {
	FunctionCall
}

func (*FunctionCallUnknown) Accept

func (*FunctionCallUnknown) Arity

func (this *FunctionCallUnknown) Arity() (int, int)

func (*FunctionCallUnknown) Copy added in v0.6.0

func (this *FunctionCallUnknown) Copy() Expression

func (*FunctionCallUnknown) Evaluate

func (this *FunctionCallUnknown) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallUpper

type FunctionCallUpper struct {
	FunctionCall
}

func (*FunctionCallUpper) Accept

func (*FunctionCallUpper) Copy added in v0.6.0

func (this *FunctionCallUpper) Copy() Expression

func (*FunctionCallUpper) Evaluate

func (this *FunctionCallUpper) Evaluate(item *dparval.Value) (*dparval.Value, error)

type FunctionCallValue

type FunctionCallValue struct {
	FunctionCall
}

func (*FunctionCallValue) Accept

func (*FunctionCallValue) Copy added in v0.6.0

func (this *FunctionCallValue) Copy() Expression

func (*FunctionCallValue) Evaluate

func (this *FunctionCallValue) Evaluate(item *dparval.Value) (*dparval.Value, error)

type GreaterThanOperator

type GreaterThanOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewGreaterThanOperator

func NewGreaterThanOperator(left, right Expression) *GreaterThanOperator

func (*GreaterThanOperator) Accept

func (*GreaterThanOperator) Copy added in v0.6.0

func (this *GreaterThanOperator) Copy() Expression

func (*GreaterThanOperator) Evaluate

func (this *GreaterThanOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type GreaterThanOrEqualOperator

type GreaterThanOrEqualOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewGreaterThanOrEqualOperator

func NewGreaterThanOrEqualOperator(left, right Expression) *GreaterThanOrEqualOperator

func (*GreaterThanOrEqualOperator) Accept

func (*GreaterThanOrEqualOperator) Copy added in v0.6.0

func (*GreaterThanOrEqualOperator) Evaluate

func (this *GreaterThanOrEqualOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type IsMissingOperator

type IsMissingOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsMissingOperator

func NewIsMissingOperator(operand Expression) *IsMissingOperator

func (*IsMissingOperator) Accept

func (*IsMissingOperator) Copy added in v0.6.0

func (this *IsMissingOperator) Copy() Expression

func (*IsMissingOperator) Evaluate

func (this *IsMissingOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type IsNotMissingOperator

type IsNotMissingOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsNotMissingOperator

func NewIsNotMissingOperator(operand Expression) *IsNotMissingOperator

func (*IsNotMissingOperator) Accept

func (*IsNotMissingOperator) Copy added in v0.6.0

func (this *IsNotMissingOperator) Copy() Expression

func (*IsNotMissingOperator) Evaluate

func (this *IsNotMissingOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type IsNotNullOperator

type IsNotNullOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsNotNullOperator

func NewIsNotNullOperator(operand Expression) *IsNotNullOperator

func (*IsNotNullOperator) Accept

func (*IsNotNullOperator) Copy added in v0.6.0

func (this *IsNotNullOperator) Copy() Expression

func (*IsNotNullOperator) Evaluate

func (this *IsNotNullOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type IsNotValuedOperator

type IsNotValuedOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsNotValuedOperator

func NewIsNotValuedOperator(operand Expression) *IsNotValuedOperator

func (*IsNotValuedOperator) Accept

func (*IsNotValuedOperator) Copy added in v0.6.0

func (this *IsNotValuedOperator) Copy() Expression

func (*IsNotValuedOperator) Evaluate

func (this *IsNotValuedOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type IsNullOperator

type IsNullOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsNullOperator

func NewIsNullOperator(operand Expression) *IsNullOperator

func (*IsNullOperator) Accept

func (this *IsNullOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*IsNullOperator) Copy added in v0.6.0

func (this *IsNullOperator) Copy() Expression

func (*IsNullOperator) Evaluate

func (this *IsNullOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type IsValuedOperator

type IsValuedOperator struct {
	Type string `json:"type"`
	UnaryOperator
}

func NewIsValuedOperator

func NewIsValuedOperator(operand Expression) *IsValuedOperator

func (*IsValuedOperator) Accept

func (this *IsValuedOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*IsValuedOperator) Copy added in v0.6.0

func (this *IsValuedOperator) Copy() Expression

func (*IsValuedOperator) Evaluate

func (this *IsValuedOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type LessThanOperator

type LessThanOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewLessThanOperator

func NewLessThanOperator(left, right Expression) *LessThanOperator

func (*LessThanOperator) Accept

func (this *LessThanOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*LessThanOperator) Copy added in v0.6.0

func (this *LessThanOperator) Copy() Expression

func (*LessThanOperator) Evaluate

func (this *LessThanOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type LessThanOrEqualOperator

type LessThanOrEqualOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewLessThanOrEqualOperator

func NewLessThanOrEqualOperator(left, right Expression) *LessThanOrEqualOperator

func (*LessThanOrEqualOperator) Accept

func (*LessThanOrEqualOperator) Copy added in v0.6.0

func (this *LessThanOrEqualOperator) Copy() Expression

func (*LessThanOrEqualOperator) Evaluate

func (this *LessThanOrEqualOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type LikeOperator

type LikeOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

**************************************************************************** Like **************************************************************************** FIXME - optimize case where RHS is string literal, only compile

the regular expression once

func NewLikeOperator

func NewLikeOperator(left, right Expression) *LikeOperator

func (*LikeOperator) Accept

func (this *LikeOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*LikeOperator) Copy added in v0.6.0

func (this *LikeOperator) Copy() Expression

func (*LikeOperator) Evaluate

func (this *LikeOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type LiteralArray

type LiteralArray struct {
	Type string         `json:"type"`
	Val  ExpressionList `json:"value"`
}

func NewLiteralArray

func NewLiteralArray(val ExpressionList) *LiteralArray

func (*LiteralArray) Accept

func (this *LiteralArray) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralArray) Copy added in v0.6.0

func (this *LiteralArray) Copy() Expression

func (*LiteralArray) Dependencies

func (this *LiteralArray) Dependencies() ExpressionList

func (*LiteralArray) EquivalentTo

func (this *LiteralArray) EquivalentTo(t Expression) bool

func (*LiteralArray) Evaluate

func (this *LiteralArray) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralArray) String

func (this *LiteralArray) String() string

type LiteralBool

type LiteralBool struct {
	Type string `json:"type"`
	Val  bool   `json:"value"`
}

func NewLiteralBool

func NewLiteralBool(val bool) *LiteralBool

func (*LiteralBool) Accept

func (this *LiteralBool) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralBool) Copy added in v0.6.0

func (this *LiteralBool) Copy() Expression

func (*LiteralBool) Dependencies

func (this *LiteralBool) Dependencies() ExpressionList

func (*LiteralBool) EquivalentTo

func (this *LiteralBool) EquivalentTo(t Expression) bool

func (*LiteralBool) Evaluate

func (this *LiteralBool) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralBool) String

func (this *LiteralBool) String() string

type LiteralNull

type LiteralNull struct {
	Type string `json:"type"`
}

func NewLiteralNull

func NewLiteralNull() *LiteralNull

func (*LiteralNull) Accept

func (this *LiteralNull) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralNull) Copy added in v0.6.0

func (this *LiteralNull) Copy() Expression

func (*LiteralNull) Dependencies

func (this *LiteralNull) Dependencies() ExpressionList

func (*LiteralNull) EquivalentTo

func (this *LiteralNull) EquivalentTo(t Expression) bool

func (*LiteralNull) Evaluate

func (this *LiteralNull) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralNull) String

func (this *LiteralNull) String() string

type LiteralNumber

type LiteralNumber struct {
	Type string  `json:"type"`
	Val  float64 `json:"value"`
}

func NewLiteralNumber

func NewLiteralNumber(val float64) *LiteralNumber

func (*LiteralNumber) Accept

func (this *LiteralNumber) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralNumber) Copy added in v0.6.0

func (this *LiteralNumber) Copy() Expression

func (*LiteralNumber) Dependencies

func (this *LiteralNumber) Dependencies() ExpressionList

func (*LiteralNumber) EquivalentTo

func (this *LiteralNumber) EquivalentTo(t Expression) bool

func (*LiteralNumber) Evaluate

func (this *LiteralNumber) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralNumber) String

func (this *LiteralNumber) String() string

type LiteralObject

type LiteralObject struct {
	Type string `json:"type"`
	Val  map[string]Expression
}

func NewLiteralObject

func NewLiteralObject(val map[string]Expression) *LiteralObject

func (*LiteralObject) Accept

func (this *LiteralObject) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralObject) Copy added in v0.6.0

func (this *LiteralObject) Copy() Expression

func (*LiteralObject) Dependencies

func (this *LiteralObject) Dependencies() ExpressionList

func (*LiteralObject) EquivalentTo

func (this *LiteralObject) EquivalentTo(t Expression) bool

func (*LiteralObject) Evaluate

func (this *LiteralObject) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralObject) String

func (this *LiteralObject) String() string

type LiteralString

type LiteralString struct {
	Type string `json:"type"`
	Val  string `json:"value"`
}

func NewLiteralString

func NewLiteralString(val string) *LiteralString

func (*LiteralString) Accept

func (this *LiteralString) Accept(ev ExpressionVisitor) (Expression, error)

func (*LiteralString) Copy added in v0.6.0

func (this *LiteralString) Copy() Expression

func (*LiteralString) Dependencies

func (this *LiteralString) Dependencies() ExpressionList

func (*LiteralString) EquivalentTo

func (this *LiteralString) EquivalentTo(t Expression) bool

func (*LiteralString) Evaluate

func (this *LiteralString) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*LiteralString) String

func (this *LiteralString) String() string

type ModuloOperator

type ModuloOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewModuloOperator

func NewModuloOperator(left, right Expression) *ModuloOperator

func (*ModuloOperator) Accept

func (this *ModuloOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*ModuloOperator) Copy added in v0.6.0

func (this *ModuloOperator) Copy() Expression

func (*ModuloOperator) Evaluate

func (this *ModuloOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type MultiplyOperator

type MultiplyOperator struct {
	Type string `json:"type"`
	CommutativeBinaryOperator
}

func NewMultiplyOperator

func NewMultiplyOperator(left, right Expression) *MultiplyOperator

func (*MultiplyOperator) Accept

func (this *MultiplyOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*MultiplyOperator) Copy added in v0.6.0

func (this *MultiplyOperator) Copy() Expression

func (*MultiplyOperator) Evaluate

func (this *MultiplyOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type NaryOperator

type NaryOperator struct {
	Operands ExpressionList `json:"operands"`
	// contains filtered or unexported fields
}

func (*NaryOperator) Dependencies

func (this *NaryOperator) Dependencies() ExpressionList

func (*NaryOperator) EquivalentTo

func (this *NaryOperator) EquivalentTo(t Expression) bool

func (*NaryOperator) GetOperands

func (this *NaryOperator) GetOperands() ExpressionList

func (*NaryOperator) Operator

func (this *NaryOperator) Operator() string

func (*NaryOperator) SetOperand

func (this *NaryOperator) SetOperand(i int, operand Expression)

func (*NaryOperator) SetOperands

func (this *NaryOperator) SetOperands(operands ExpressionList)

func (*NaryOperator) String

func (this *NaryOperator) String() string

type NaryOperatorExpression

type NaryOperatorExpression interface {
	OperatorExpression
	GetOperands() ExpressionList
	SetOperands(ExpressionList)
	SetOperand(int, Expression)
}

type NotEqualToOperator

type NotEqualToOperator struct {
	Type string `json:"type"`
	CommutativeBinaryOperator
}

func NewNotEqualToOperator

func NewNotEqualToOperator(left, right Expression) *NotEqualToOperator

func (*NotEqualToOperator) Accept

func (*NotEqualToOperator) Copy added in v0.6.0

func (this *NotEqualToOperator) Copy() Expression

func (*NotEqualToOperator) Evaluate

func (this *NotEqualToOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type NotLikeOperator

type NotLikeOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

**************************************************************************** Not Like **************************************************************************** FIXME - consolidate common code with LIKE

func NewNotLikeOperator

func NewNotLikeOperator(left, right Expression) *NotLikeOperator

func (*NotLikeOperator) Accept

func (this *NotLikeOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*NotLikeOperator) Copy added in v0.6.0

func (this *NotLikeOperator) Copy() Expression

func (*NotLikeOperator) Evaluate

func (this *NotLikeOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type NotOperator

type NotOperator struct {
	Type string `json:"type"`
	PrefixUnaryOperator
}

func NewNotOperator

func NewNotOperator(operand Expression) *NotOperator

func (*NotOperator) Accept

func (this *NotOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*NotOperator) Copy added in v0.6.0

func (this *NotOperator) Copy() Expression

func (*NotOperator) Evaluate

func (this *NotOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type OperatorExpression

type OperatorExpression interface {
	Operator() string
}

type OrOperator

type OrOperator struct {
	Type string `json:"type"`
	NaryOperator
}

func NewOrOperator

func NewOrOperator(operands ExpressionList) *OrOperator

func (*OrOperator) Accept

func (this *OrOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*OrOperator) Copy added in v0.6.0

func (this *OrOperator) Copy() Expression

func (*OrOperator) Evaluate

func (this *OrOperator) Evaluate(item *dparval.Value) (*dparval.Value, error)

type PlusOperator

type PlusOperator struct {
	Type string `json:"type"`
	CommutativeBinaryOperator
}

func NewPlusOperator

func NewPlusOperator(left, right Expression) *PlusOperator

func (*PlusOperator) Accept

func (this *PlusOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*PlusOperator) Copy added in v0.6.0

func (this *PlusOperator) Copy() Expression

func (*PlusOperator) Evaluate

func (this *PlusOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type PrefixUnaryOperator

type PrefixUnaryOperator struct {
	UnaryOperator
}

func (*PrefixUnaryOperator) String

func (this *PrefixUnaryOperator) String() string

type Property

type Property struct {
	Type string `json:"type"`
	Path string `json:"path"`
}

func NewProperty

func NewProperty(path string) *Property

func (*Property) Accept

func (this *Property) Accept(ev ExpressionVisitor) (Expression, error)

func (*Property) Copy added in v0.6.0

func (this *Property) Copy() Expression

func (*Property) Dependencies

func (this *Property) Dependencies() ExpressionList

func (*Property) EquivalentTo

func (this *Property) EquivalentTo(t Expression) bool

func (*Property) Evaluate

func (this *Property) Evaluate(item *dparval.Value) (*dparval.Value, error)

func (*Property) String

func (this *Property) String() string

type ResultExpression

type ResultExpression struct {
	Star bool       `json:"star"`
	Expr Expression `json:"expr"`
	As   string     `json:"as"`
}

func NewDotStarResultExpression

func NewDotStarResultExpression(expr Expression) *ResultExpression

func NewResultExpression

func NewResultExpression(expr Expression) *ResultExpression

func NewResultExpressionWithAlias

func NewResultExpressionWithAlias(expr Expression, as string) *ResultExpression

func NewStarResultExpression

func NewStarResultExpression() *ResultExpression

type ResultExpressionList

type ResultExpressionList []*ResultExpression

func (ResultExpressionList) AssignDefaultNames

func (this ResultExpressionList) AssignDefaultNames(namesInUse []string) error

this function should walk through the result expression list assign names to any unnamed expressions

func (ResultExpressionList) CheckForDuplicateAliases

func (this ResultExpressionList) CheckForDuplicateAliases() ([]string, error)

this function should be called before assigning default names it should check to see if any explicitly named aliases are duplicated if so, this is an error

func (ResultExpressionList) ContainsAggregateFunctionCall

func (this ResultExpressionList) ContainsAggregateFunctionCall() bool

func (ResultExpressionList) ExpressionList

func (this ResultExpressionList) ExpressionList() ExpressionList

return all the expressions in the projection as an ExpressionList will leave out * and path.* expressions

func (ResultExpressionList) Simplify

func (this ResultExpressionList) Simplify() error

func (ResultExpressionList) String

func (this ResultExpressionList) String() string

func (ResultExpressionList) Validate

func (this ResultExpressionList) Validate() error

func (ResultExpressionList) VerifyAllAggregateFunctionsOrInThisList

func (this ResultExpressionList) VerifyAllAggregateFunctionsOrInThisList(groupBy ExpressionList) error

func (ResultExpressionList) VerifyFormalNotation

func (this ResultExpressionList) VerifyFormalNotation(forbiddenAliases []string, aliases []string, defaultAlias string) error

type SelectStatement

type SelectStatement struct {
	Distinct    bool                 `json:"distinct"`
	Select      ResultExpressionList `json:"select"`
	From        *From                `json:"from"`
	Where       Expression           `json:"where"`
	GroupBy     ExpressionList       `json:"group_by"`
	Having      Expression           `json:"having"`
	OrderBy     SortExpressionList   `json:"orderby"`
	Limit       int                  `json:"limit"`
	Offset      int                  `json:"offset"`
	ExplainOnly bool                 `json:"explain"`
	// contains filtered or unexported fields
}

func NewSelectStatement

func NewSelectStatement() *SelectStatement

func (*SelectStatement) GetAggregateReferences

func (this *SelectStatement) GetAggregateReferences() ExpressionList

func (*SelectStatement) GetExplicitProjectionAliases

func (this *SelectStatement) GetExplicitProjectionAliases() []string

func (*SelectStatement) GetFrom

func (this *SelectStatement) GetFrom() *From

func (*SelectStatement) GetFromAliases

func (this *SelectStatement) GetFromAliases() []string

func (*SelectStatement) GetGroupBy

func (this *SelectStatement) GetGroupBy() ExpressionList

func (*SelectStatement) GetHaving

func (this *SelectStatement) GetHaving() Expression

func (*SelectStatement) GetLimit

func (this *SelectStatement) GetLimit() int

func (*SelectStatement) GetOffset

func (this *SelectStatement) GetOffset() int

func (*SelectStatement) GetOrderBy

func (this *SelectStatement) GetOrderBy() SortExpressionList

func (*SelectStatement) GetResultExpressionList

func (this *SelectStatement) GetResultExpressionList() ResultExpressionList

func (*SelectStatement) GetWhere

func (this *SelectStatement) GetWhere() Expression

func (*SelectStatement) IsAggregate

func (this *SelectStatement) IsAggregate() bool

func (*SelectStatement) IsDistinct

func (this *SelectStatement) IsDistinct() bool

func (*SelectStatement) IsExplainOnly

func (this *SelectStatement) IsExplainOnly() bool

func (*SelectStatement) SetExplainOnly

func (this *SelectStatement) SetExplainOnly(explainOnly bool)

func (*SelectStatement) Simplify

func (this *SelectStatement) Simplify() error

func (*SelectStatement) VerifySemantics

func (this *SelectStatement) VerifySemantics() error

type SortExpression

type SortExpression struct {
	Expr      Expression `json:"expr"`
	Ascending bool       `json:"asc"`
}

func NewSortExpression

func NewSortExpression(expr Expression, asc bool) *SortExpression

type SortExpressionList

type SortExpressionList []*SortExpression

func (SortExpressionList) Simplify

func (this SortExpressionList) Simplify() error

func (SortExpressionList) String

func (this SortExpressionList) String() string

func (SortExpressionList) Validate

func (this SortExpressionList) Validate() error

func (SortExpressionList) VerifyAllAggregateFunctionsOrInThisList

func (this SortExpressionList) VerifyAllAggregateFunctionsOrInThisList(groupBy ExpressionList) error

func (SortExpressionList) VerifyAllEquivalentToThisList

func (this SortExpressionList) VerifyAllEquivalentToThisList(exprs ExpressionList) error

func (SortExpressionList) VerifyFormalNotation

func (this SortExpressionList) VerifyFormalNotation(forbiddenAliases []string, aliases []string, defaultAlias string) error

type Statement

type Statement interface {
	SetExplainOnly(bool)
	IsExplainOnly() bool
	VerifySemantics() error
	Simplify() error
}

Statement is the abstract representation of an N1QL statement

type StringConcatenateOperator

type StringConcatenateOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewStringConcatenateOperator

func NewStringConcatenateOperator(left, right Expression) *StringConcatenateOperator

func (*StringConcatenateOperator) Accept

func (*StringConcatenateOperator) Copy added in v0.6.0

func (*StringConcatenateOperator) Evaluate

func (this *StringConcatenateOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type SubtractOperator

type SubtractOperator struct {
	Type string `json:"type"`
	BinaryOperator
}

func NewSubtractOperator

func NewSubtractOperator(left, right Expression) *SubtractOperator

func (*SubtractOperator) Accept

func (this *SubtractOperator) Accept(ev ExpressionVisitor) (Expression, error)

func (*SubtractOperator) Copy added in v0.6.0

func (this *SubtractOperator) Copy() Expression

func (*SubtractOperator) Evaluate

func (this *SubtractOperator) Evaluate(context *dparval.Value) (*dparval.Value, error)

type TypeMismatch

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

func (*TypeMismatch) Error

func (this *TypeMismatch) Error() string

type UnaryOperator

type UnaryOperator struct {
	Operand Expression `json:"operand"`
	// contains filtered or unexported fields
}

func (*UnaryOperator) Dependencies

func (this *UnaryOperator) Dependencies() ExpressionList

func (*UnaryOperator) EquivalentTo

func (this *UnaryOperator) EquivalentTo(t Expression) bool

func (*UnaryOperator) EvaluateFlagMissing

func (this *UnaryOperator) EvaluateFlagMissing(context *dparval.Value) (*dparval.Value, bool, error)

func (*UnaryOperator) EvaluateRequireNumber

func (this *UnaryOperator) EvaluateRequireNumber(context *dparval.Value) (float64, bool, error)

func (*UnaryOperator) GetOperand

func (this *UnaryOperator) GetOperand() Expression

func (*UnaryOperator) Operator

func (this *UnaryOperator) Operator() string

func (*UnaryOperator) SetOperand

func (this *UnaryOperator) SetOperand(operand Expression)

func (*UnaryOperator) String

func (this *UnaryOperator) String() string

type UnaryOperatorExpression

type UnaryOperatorExpression interface {
	OperatorExpression
	GetOperand() Expression
	SetOperand(Expression)
}

type WhenThen

type WhenThen struct {
	When Expression `json:"when"`
	Then Expression `json:"then"`
}

Jump to

Keyboard shortcuts

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