-
-
Notifications
You must be signed in to change notification settings - Fork 234
Fix prep AS OF #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix prep AS OF #1054
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,7 +268,11 @@ func reresolveTables(ctx *sql.Context, a *Analyzer, node sql.Node, scope *Scope, | |
if n.Database != nil { | ||
db = n.Database.Name() | ||
} | ||
to, err = resolveTable(ctx, plan.NewUnresolvedTable(n.Name(), db), a) | ||
var asof sql.Expression | ||
if n.AsOf != nil { | ||
asof = expression.NewLiteral(n.AsOf, nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this conversion step necessary? Why not just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The constructor expected an sql.Expression argument There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could do more work to clean up asof handling/do a type inference if you want |
||
} | ||
to, err = resolveTable(ctx, plan.NewUnresolvedTableAsOf(n.Name(), db, asof), a) | ||
if err != nil { | ||
return nil, transform.SameTree, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this conversion step necessary? Why not just
resolveTable(plan.NewUnresolvedTableAsOf(n.name, db, n.AsOf)
?