expression

package
v0.0.0-...-959c02d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	VariableRef *VariableRef
	PropertyRef *PropertyRef
	Expr        Expression
}

Assignment represents an assignment in INSERT/UPDATE statements.

e.g: INSERT VERTEX x LABELS ( Male ) PROPERTIES ( x.age = 22 ) UPDATE x SET ( x.age = 42 ) FROM MATCH (x:Person) WHERE x.name = 'John'

type BinaryEvalOp

type BinaryEvalOp interface {
	InferReturnType(leftType, rightType types.T) types.T
	CallOnNullInput() bool
	Eval(stmtCtx *stmtctx.Context, left, right datum.Datum) (datum.Datum, error)
}

type BinaryExpr

type BinaryExpr struct {
	Op     opcode.Op
	Left   Expression
	Right  Expression
	EvalOp BinaryEvalOp
}

func NewBinaryExpr

func NewBinaryExpr(op opcode.Op, left, right Expression) (*BinaryExpr, error)

func (*BinaryExpr) Eval

func (expr *BinaryExpr) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*BinaryExpr) ReturnType

func (expr *BinaryExpr) ReturnType() types.T

func (*BinaryExpr) String

func (expr *BinaryExpr) String() string

type CastExpr

type CastExpr struct {
	Expr Expression
	Type types.T
}

func NewCastExpr

func NewCastExpr(expr Expression, typ types.T) *CastExpr

func (*CastExpr) Eval

func (c *CastExpr) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*CastExpr) ReturnType

func (c *CastExpr) ReturnType() types.T

func (*CastExpr) String

func (c *CastExpr) String() string

type Column

type Column struct {
	Index int
	Name  model.CIStr
	Type  types.T
}

func (*Column) Eval

func (c *Column) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*Column) ReturnType

func (c *Column) ReturnType() types.T

func (*Column) String

func (c *Column) String() string

type Constant

type Constant struct {
	Value datum.Datum
}

Constant represents a literal constant.

func (*Constant) Eval

func (c *Constant) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*Constant) ReturnType

func (c *Constant) ReturnType() types.T

func (*Constant) String

func (c *Constant) String() string

String implements the fmt.Stringer interface.

type Expression

type Expression interface {
	fmt.Stringer
	ReturnType() types.T
	Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)
}

type FuncExpr

type FuncExpr struct {
	Name string
	Args []Expression
	Fn   Function
}

func NewFuncExpr

func NewFuncExpr(name string, args ...Expression) (*FuncExpr, error)

func (*FuncExpr) Eval

func (expr *FuncExpr) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*FuncExpr) ReturnType

func (expr *FuncExpr) ReturnType() types.T

func (*FuncExpr) String

func (expr *FuncExpr) String() string

type Function

type Function interface {
	NumArgs() int
	InferReturnType(argTypes []types.T) types.T
	CallOnNullInput() bool
	Eval(stmtCtx *stmtctx.Context, args []datum.Datum) (datum.Datum, error)
}

type PropertyAccess

type PropertyAccess struct {
	Expr         Expression
	VariableName model.CIStr
	PropertyName model.CIStr
}

PropertyAccess represents a property access expression.

func (*PropertyAccess) Eval

func (p *PropertyAccess) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*PropertyAccess) ReturnType

func (p *PropertyAccess) ReturnType() types.T

func (*PropertyAccess) String

func (p *PropertyAccess) String() string

type PropertyRef

type PropertyRef struct {
	Property *model.PropertyInfo
}

PropertyRef represents the accessor of vertex/edge's property.

func (*PropertyRef) Clone

func (f *PropertyRef) Clone() *PropertyRef

func (*PropertyRef) String

func (f *PropertyRef) String() string

String implements the fmt.Stringer interface

type UnaryEvalOp

type UnaryEvalOp interface {
	InferReturnType(inputType types.T) types.T
	CallOnNullInput() bool
	Eval(stmtCtx *stmtctx.Context, input datum.Datum) (datum.Datum, error)
}

type UnaryExpr

type UnaryExpr struct {
	Op     opcode.Op
	Expr   Expression
	EvalOp UnaryEvalOp
}

func NewUnaryExpr

func NewUnaryExpr(op opcode.Op, expr Expression) (*UnaryExpr, error)

func (*UnaryExpr) Eval

func (u *UnaryExpr) Eval(stmtCtx *stmtctx.Context, input datum.Row) (datum.Datum, error)

func (*UnaryExpr) ReturnType

func (u *UnaryExpr) ReturnType() types.T

func (*UnaryExpr) String

func (u *UnaryExpr) String() string

type VariableRef

type VariableRef struct {
	Name model.CIStr
}

VariableRef represents a variable referenced by other scope.

e.g: INSERT VERTEX x LABELS ( Male ) PROPERTIES ( x.age = 22 ) --------------^------------------------------^----------

func (*VariableRef) String

func (v *VariableRef) String() string

Jump to

Keyboard shortcuts

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