Skip to content
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

have plan.EmptyTable implement sql.DeletableTable #1887

Merged
merged 5 commits into from Jul 21, 2023
Merged

have plan.EmptyTable implement sql.DeletableTable #1887

merged 5 commits into from Jul 21, 2023

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Jul 21, 2023

We throw an error when trying to delete from EmptyTable.
This error is partially caused by #1885

The error didn't show up in GMS as there are Exchange nodes that appear in dolt side that don't appear here.

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, i don't totally get where the exchange node broke this but the change seems fine

@@ -85,9 +85,6 @@ func (b *BaseBuilder) buildInsertInto(ctx *sql.Context, ii *plan.InsertInto, row
func (b *BaseBuilder) buildDeleteFrom(ctx *sql.Context, n *plan.DeleteFrom, row sql.Row) (sql.RowIter, error) {
// If an empty table is passed in (potentially from a bad filter) return an empty row iter.
// Note: emptyTable could also implement sql.DetetableTable
if _, ok := n.Child.(*plan.EmptyTable); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we delete the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will delete comment.

if n.Child is an Exchange node it fails the EmptyTable check here, an alternative would be to use transform.Inspect to look for EmptyTable maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current pattern seems fine, folding x->EmptyTable into EmptyTable is analyzer responsibility not executions

@jycor jycor merged commit e305600 into main Jul 21, 2023
6 checks passed
@Hydrocharged Hydrocharged deleted the james/delete branch August 24, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants