stream: clone stream before execution

This commit is contained in:
Asdine El Hrychy
2024-02-17 17:56:41 +04:00
parent bac26ce46a
commit 71146bcc9b
37 changed files with 464 additions and 13 deletions

View File

@@ -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) {