Documentation ¶
Index ¶
- Variables
- func CanBeVariableName(s string) (bool, []string)
- func FindAllUDFStrings(query string) ([][]string, error)
- type AggregatorTypeOfUDF
- type ExprScriptInstance
- func (exprInstance *ExprScriptInstance) Body() string
- func (exprInstance *ExprScriptInstance) Dialect() string
- func (exprInstance *ExprScriptInstance) EvalFromString(expressionString string) (interface{}, error)
- func (exprInstance *ExprScriptInstance) ScriptEval(scriptEnvironment map[string]interface{}) (interface{}, error)
- type JSScriptInstance
- func (jsScriptInstance *JSScriptInstance) Body() string
- func (jsScriptInstance *JSScriptInstance) Dialect() string
- func (jsScriptInstance *JSScriptInstance) EvalFromString(expressionString string) (interface{}, error)
- func (jsScriptInstance *JSScriptInstance) ScriptEval(scriptEnvironment map[string]interface{}) (interface{}, error)
- type ScriptInstance
- type ScriptUDF
- type Scriptable
- func (a *Scriptable) Children() []sql.Expression
- func (a *Scriptable) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)
- func (a *Scriptable) EvalScript(ctx *sql.Context, row sql.Row, partial interface{}) (interface{}, error)
- func (a *Scriptable) IsNullable() bool
- func (a *Scriptable) Merge(ctx *sql.Context, buffer, partial sql.Row) error
- func (a *Scriptable) NewBuffer() sql.Row
- func (a *Scriptable) Resolved() bool
- func (a *Scriptable) String() string
- func (a *Scriptable) Type() sql.Type
- func (a *Scriptable) Update(ctx *sql.Context, buffer, row sql.Row) error
- func (a *Scriptable) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type TypeOfUDF
Constants ¶
This section is empty.
Variables ¶
var AggregatorRegex = regexp.MustCompile(`^<\?([LS][F_][T_])|(AG[GT])@.+`)
var ParamRegex = regexp.MustCompile(`@{([^(@{)^}]+)}`)
within UDF this does parameter extraction
Functions ¶
func CanBeVariableName ¶
func FindAllUDFStrings ¶
Extract out macros, failed with regex. TODO Sandy to find out better alternatives
Types ¶
type AggregatorTypeOfUDF ¶
type AggregatorTypeOfUDF int
const ( NotAnAggregator AggregatorTypeOfUDF = 0 ListAggregator AggregatorTypeOfUDF = 1 SetAggregator AggregatorTypeOfUDF = 2 GenericAggregator AggregatorTypeOfUDF = 3 )
type ExprScriptInstance ¶
type ExprScriptInstance struct {
// contains filtered or unexported fields
}
func (*ExprScriptInstance) Body ¶
func (exprInstance *ExprScriptInstance) Body() string
func (*ExprScriptInstance) Dialect ¶
func (exprInstance *ExprScriptInstance) Dialect() string
func (*ExprScriptInstance) EvalFromString ¶
func (exprInstance *ExprScriptInstance) EvalFromString(expressionString string) (interface{}, error)
func (*ExprScriptInstance) ScriptEval ¶
func (exprInstance *ExprScriptInstance) ScriptEval(scriptEnvironment map[string]interface{}) (interface{}, error)
type JSScriptInstance ¶
type JSScriptInstance struct {
// contains filtered or unexported fields
}
func (*JSScriptInstance) Body ¶
func (jsScriptInstance *JSScriptInstance) Body() string
func (*JSScriptInstance) Dialect ¶
func (jsScriptInstance *JSScriptInstance) Dialect() string
func (*JSScriptInstance) EvalFromString ¶
func (jsScriptInstance *JSScriptInstance) EvalFromString(expressionString string) (interface{}, error)
func (*JSScriptInstance) ScriptEval ¶
func (jsScriptInstance *JSScriptInstance) ScriptEval(scriptEnvironment map[string]interface{}) (interface{}, error)
type ScriptInstance ¶
type ScriptInstance interface { Dialect() string Body() string EvalFromString(expressionString string) (interface{}, error) ScriptEval(scriptEnvironment map[string]interface{}) ( interface{}, error, ) }
func GetScriptInstance ¶
func GetScriptInstance(langString string, bodyString string) ScriptInstance
type ScriptUDF ¶
type ScriptUDF struct { Id string Script ScriptInstance UdfType TypeOfUDF // contains filtered or unexported fields }
func MacroProcessor ¶
func (*ScriptUDF) AsFunction ¶
func (*ScriptUDF) Fn ¶
func (s *ScriptUDF) Fn(args ...sql.Expression) (sql.Expression, error)
type Scriptable ¶
type Scriptable struct { Meta *ScriptUDF // contains filtered or unexported fields }
func (*Scriptable) Children ¶
func (a *Scriptable) Children() []sql.Expression
func (*Scriptable) Eval ¶
Eval implements AggregationExpression interface. (AggregationExpression[Expression]])
func (*Scriptable) EvalScript ¶
func (*Scriptable) IsNullable ¶
func (a *Scriptable) IsNullable() bool
IsNullable implements AggregationExpression interface. (AggregationExpression[Expression]])
func (*Scriptable) Merge ¶
Merge implements AggregationExpression interface. (AggregationExpression)
func (*Scriptable) NewBuffer ¶
func (a *Scriptable) NewBuffer() sql.Row
NewBuffer implements AggregationExpression interface. (AggregationExpression)
func (*Scriptable) Resolved ¶
func (a *Scriptable) Resolved() bool
Resolved implements AggregationExpression interface. (AggregationExpression[Expression[Resolvable]]])
func (*Scriptable) String ¶
func (a *Scriptable) String() string
func (*Scriptable) Type ¶
func (a *Scriptable) Type() sql.Type
Type implements AggregationExpression interface. (AggregationExpression[Expression]])
func (*Scriptable) Update ¶
Update implements AggregationExpression interface. (AggregationExpression)
func (*Scriptable) WithChildren ¶
func (a *Scriptable) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type TypeOfUDF ¶
type TypeOfUDF struct { IsAggregator bool AggregatorType AggregatorTypeOfUDF Flatten bool Transpose bool }
func AggregatorType ¶
* Let's define the protocol : Here L__ -> List, no flatten, no transpose L_T -> List, no flatten, Transpose LFT -> List, Flatten, Transpose
S__ -> Set, no flatten, no transpose S_T -> Set, no flatten, Transpose SFT -> Set, Flatten, Transpose
--> AGG can not have flatten it is upto author AGG -> Aggregate, no flatten, no transpose AGT -> AGG, no flatten, Transpose