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

Use evalengine for Vindex lookups in route primitive #9291

Merged
merged 15 commits into from
Dec 5, 2021

Conversation

systay
Copy link
Collaborator

@systay systay commented Nov 29, 2021

Description

This PR replaces PlanValue with EvalEngineExpr to be used in route primitive. Created a separate logical plan and engine primitive of route for Gen4 planner.

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

@systay systay added Component: Query Serving release notes Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Nov 29, 2021
go/vt/vtgate/evalengine/expressions.go Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/plan_test.go Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/select.go Outdated Show resolved Hide resolved
go/vt/vtgate/planbuilder/testdata/ddl_cases.txt Outdated Show resolved Hide resolved
systay and others added 8 commits December 2, 2021 13:31
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
…r will not use the returned value if it is nil and will check for other expression

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…egacy back to route (v3)

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
if n.selectedVindex() != nil {
singleColumn = n.selected.foundVindex.(vindexes.SingleColumn)
values = n.selected.values
if len(n.selected.values) == 1 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is this safe to do? @harshit-gangal

Copy link
Member

Choose a reason for hiding this comment

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

the length is always going to be 1 for singleColumn Vindex. This check is not required.

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal changed the title Use evalengine for Vindex lookups Use evalengine for Vindex lookups in route primitive Dec 2, 2021
case querypb.Type_TUPLE:
tuple := make([]EvalResult, 0, len(val.Values))
for _, value := range val.Values {
single, err := evaluateByTypeSingle(value.Type, value.Value)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this should be evaluateByType, so we can support tuples inside of tuples

Copy link
Member

Choose a reason for hiding this comment

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

that takes in bindvariable and val.Values range will give query.Value

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal merged commit 2e22f46 into vitessio:main Dec 5, 2021
@harshit-gangal harshit-gangal deleted the vindex-eval-engine branch December 5, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants