func (l *Limit) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
	span, ctx := ctx.Span("plan.Limit", opentracing.Tag{Key: "limit", Value: l.Limit})
	limit, err := getInt64Value(ctx, l.Limit)
	if err != nil {
		return nil, err
	}
	childIter, err := l.Child.RowIter(ctx, row)
	if err != nil {
		span.Finish()
		return nil, err
	}
	return sql.NewSpanIter(span, &limitIter{
		l:         l,
		limit:     limit,
		childIter: childIter,
	}), nil
}
RowIter implements the Node interface.
package plan
import (
	"fmt"
	"io"
	opentracing "github.com/opentracing/opentracing-go"
	"github.com/dolthub/go-mysql-server/sql"
)
type Limit struct {
	UnaryNode
	Limit         sql.Expression
	CalcFoundRows bool
}
func NewLimit(size sql.Expression, child sql.Node) *Limit {
	return &Limit{
		UnaryNode: UnaryNode{Child: child},
		Limit:     size,
	}
}
func (l *Limit) Expressions() []sql.Expression {
	return []sql.Expression{l.Limit}
}
func (l Limit) WithExpressions(exprs ...sql.Expression) (sql.Node, error) {
	if len(exprs) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(l, len(exprs), 1)
	}
	nl := &l
	nl.Limit = exprs[0]
	return nl, nil
}
func (l *Limit) Resolved() bool {
	return l.UnaryNode.Child.Resolved() && l.Limit.Resolved()
}