func (s *Sin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	val, err := s.EvalChild(ctx, row)
	if err != nil {
		return nil, err
	}
	if val == nil {
		return nil, nil
	}
	n, err := sql.Float64.Convert(val)
	if err != nil {
		return nil, err
	}
	return math.Sin(n.(float64)), nil
}
Eval implements sql.Expression
package function
import (
	"fmt"
	"hash/crc32"
	"math"
	"math/rand"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/shopspring/decimal"
	"github.com/dolthub/go-mysql-server/sql"
)
type Rand struct {
	Child sql.Expression
}
var _ sql.Expression = (*Rand)(nil)
var _ sql.NonDeterministicExpression = (*Rand)(nil)
var _ sql.FunctionExpression = (*Rand)(nil)
func NewRand(exprs ...sql.Expression) (sql.Expression, error) {
	if len(exprs) > 1 {
		return nil, sql.ErrInvalidArgumentNumber.New("rand", "0 or 1", len(exprs))
	}
	if len(exprs) > 0 {
		return &Rand{Child: exprs[0]}, nil
	}
	return &Rand{}, nil
}
func (r *Rand) FunctionName() string {
	return "rand"
}
func (r *Rand) Type() sql.Type {
	return sql.Float64
}
func (r *Rand) IsNonDeterministic() bool {
	return r.Child == nil
}
func (r *Rand) IsNullable() bool {
	return false
}
func (r *Rand) Resolved() bool {
	return r.Child == nil || r.Child.Resolved()
}
func (r *Rand) String() string {
	if r.Child != nil {
		return fmt.Sprintf("RAND(%s)", r.Child)
	}
	return fmt.Sprintf("RAND()")
}
func (r *Rand) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) > 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(r, len(children), 1)
	}
	if len(children) == 0 {
		return r, nil
	}
	return NewRand(children[0])
}
func (r *Rand) Children() []sql.Expression {
	if r.Child == nil {
		return nil
	}
	return []sql.Expression{r.Child}
}
func (r *Rand) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	if r.Child == nil {
		return rand.Float64(), nil
	}
	e, err := r.Child.Eval(ctx, row)
	if err != nil {
		return nil, err
	}
	var seed int64
	if sql.IsNumber(r.Child.Type()) {
		e, err = sql.Int64.Convert(e)
		if err == nil {
			seed = e.(int64)
		}
	}
	return rand.New(rand.NewSource(seed)).Float64(), nil
}
type Sin struct {
	*UnaryFunc
}
var _ sql.FunctionExpression = (*Sin)(nil)
func NewSin(arg sql.Expression) sql.Expression {
	return &Sin{NewUnaryFunc(arg, "SIN", sql.Float64)}
}