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

Return errors instead of asserting inside runQueryPrepared #1231

Merged
merged 4 commits into from
Sep 2, 2022

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Sep 1, 2022

@jycor jycor changed the title call HandleFilters during transferProjection and properly test prepared errors call HandleFilters during transferProjection Sep 1, 2022
@@ -346,6 +346,7 @@ func transferProjections(ctx *sql.Context, from, to *plan.ResolvedTable) *plan.R
}

if _, ok := toTable.(sql.FilteredTable); ok {
toTable.(sql.FilteredTable).HandledFilters(filters)
Copy link
Contributor

Choose a reason for hiding this comment

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

Something is off here. HandledFilters seems like a non-mutating method when I look at the analyzer? And WithFilters is mutating? So it doesn't seem like Dolt tables should only mutate for the HandledFilters call? I'd think Dolt commit table should answer HandledTables and mutate on WithFilters I guess, so not really a GMS problem unless the interfaces are wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Max is right. This is HandledFilters, it's supposed to return the subset of predicate expressions that can be pushed down to the table. The use here is a no-op.

If the memory table implementation is doing something different, that's a bug.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

See comments

@@ -346,6 +346,7 @@ func transferProjections(ctx *sql.Context, from, to *plan.ResolvedTable) *plan.R
}

if _, ok := toTable.(sql.FilteredTable); ok {
toTable.(sql.FilteredTable).HandledFilters(filters)
Copy link
Member

Choose a reason for hiding this comment

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

Max is right. This is HandledFilters, it's supposed to return the subset of predicate expressions that can be pushed down to the table. The use here is a no-op.

If the memory table implementation is doing something different, that's a bug.

@jycor jycor changed the title call HandleFilters during transferProjection Return errors instead of asserting inside runQueryPrepared Sep 2, 2022
@jycor jycor merged commit c4e28f0 into main Sep 2, 2022
@Hydrocharged Hydrocharged deleted the james/prepareds5 branch October 13, 2022 12:50
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

3 participants