func (j *InnerJoin) WithExpressions(exprs ...sql.Expression) (sql.Node, error) {
	if len(exprs) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(j, len(exprs), 1)
	}
	return NewInnerJoin(j.Left, j.Right, exprs[0]), nil
}
WithExpressions implements the Expressioner interface.
package plan
import (
	"io"
	"os"
	"reflect"
	"strings"
	opentracing "github.com/opentracing/opentracing-go"
	"github.com/src-d/go-mysql-server/sql"
)
const (
	inMemoryJoinKey        = "INMEMORY_JOINS"
	inMemoryJoinSessionVar = "inmemory_joins"
)
var useInMemoryJoins = shouldUseMemoryJoinsByEnv()
func shouldUseMemoryJoinsByEnv() bool {
	v := strings.TrimSpace(strings.ToLower(os.Getenv(inMemoryJoinKey)))
	return v == "on" || v == "1"
}
type InnerJoin struct {
	BinaryNode
	Cond sql.Expression
}
func NewInnerJoin(left, right sql.Node, cond sql.Expression) *InnerJoin {
	return &InnerJoin{
		BinaryNode: BinaryNode{
			Left:  left,
			Right: right,
		},
		Cond: cond,
	}
}
func (j *InnerJoin) Schema() sql.Schema {
	return append(j.Left.Schema(), j.Right.Schema()...)
}
func (j *InnerJoin) Resolved() bool {
	return j.Left.Resolved() && j.Right.Resolved() && j.Cond.Resolved()
}
func (j *InnerJoin) RowIter(ctx *sql.Context) (sql.RowIter, error) {
	return joinRowIter(ctx, innerJoin, j.Left, j.Right, j.Cond)
}
func (j *InnerJoin) WithChildren(children ...sql.Node) (sql.Node, error) {
	if len(children) != 2 {
		return nil, sql.ErrInvalidChildrenNumber.New(j, len(children), 2)
	}
	return NewInnerJoin(children[0], children[1], j.Cond), nil
}