func expandStars(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope) (sql.Node, error) {
	span, _ := ctx.Span("expand_stars")
	defer span.Finish()
	tableAliases, err := getTableAliases(n, scope)
	if err != nil {
		return nil, err
	}
	return plan.TransformUp(n, func(n sql.Node) (sql.Node, error) {
		if n.Resolved() {
			return n, nil
		}
		switch n := n.(type) {
		case *plan.Project:
			if !n.Child.Resolved() {
				return n, nil
			}
			expanded, err := expandStarsForExpressions(a, n.Projections, n.Child.Schema(), tableAliases)
			if err != nil {
				return nil, err
			}
			return plan.NewProject(expanded, n.Child), nil
		case *plan.GroupBy:
			if !n.Child.Resolved() {
				return n, nil
			}
			expanded, err := expandStarsForExpressions(a, n.SelectedExprs, n.Child.Schema(), tableAliases)
			if err != nil {
				return nil, err
			}
			return plan.NewGroupBy(expanded, n.GroupByExprs, n.Child), nil
		case *plan.Window:
			if !n.Child.Resolved() {
				return n, nil
			}
			expanded, err := expandStarsForExpressions(a, n.SelectExprs, n.Child.Schema(), tableAliases)
			if err != nil {
				return nil, err
			}
			return plan.NewWindow(expanded, n.Child), nil
		default:
			return n, nil
		}
	})
}
expandStars replaces star expressions into lists of concrete column expressions
package analyzer
import (
	"strings"
	"github.com/dolthub/go-mysql-server/sql"
	"github.com/dolthub/go-mysql-server/sql/expression"
	"github.com/dolthub/go-mysql-server/sql/plan"
)