mirror of
https://github.com/chaisql/chai.git
synced 2025-10-06 08:06:55 +08:00
stream: clone stream before execution
This commit is contained in:
@@ -56,6 +56,18 @@ type ScalarFunction struct {
|
||||
params []expr.Expr
|
||||
}
|
||||
|
||||
func (sf *ScalarFunction) Clone() expr.Expr {
|
||||
exprs := make([]expr.Expr, 0, len(sf.params))
|
||||
for _, e := range sf.params {
|
||||
exprs = append(exprs, expr.Clone(e))
|
||||
}
|
||||
|
||||
return &ScalarFunction{
|
||||
def: sf.def,
|
||||
params: exprs,
|
||||
}
|
||||
}
|
||||
|
||||
// Eval returns a row.Value based on the given environment and the underlying function
|
||||
// definition.
|
||||
func (sf *ScalarFunction) Eval(env *environment.Environment) (types.Value, error) {
|
||||
|
Reference in New Issue
Block a user