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

[Gen4] Implemented table alias functionality in the semantic analysis #7629

Merged
merged 10 commits into from
Apr 27, 2021

Conversation

systay
Copy link
Collaborator

@systay systay commented Mar 7, 2021

Description

This PR teaches the semantic analysis how to deal with table aliases.
Every table mentioned in the FROM will now either be explicitly qualified with the database name, or the current database is used to qualify the table.
This PR also adds support for routed tables, which depend on table aliases being available.

Checklist

  • Should this PR be backported? Nope
  • Tests were added or are not required Lots of tests added
  • Documentation was added or is not required Not required

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving

@systay systay requested a review from harshit-gangal as a code owner March 7, 2021 09:24
@systay systay mentioned this pull request Mar 7, 2021
13 tasks
@systay systay force-pushed the gen4-table-aliases branch from a68f4fa to 4239473 Compare March 19, 2021 07:38
@systay systay force-pushed the gen4-table-aliases branch from fa60cbb to c61f7e2 Compare April 12, 2021 05:19
@systay systay marked this pull request as draft April 12, 2021 08:27
@systay systay force-pushed the gen4-table-aliases branch from c61f7e2 to 8b6e836 Compare April 12, 2021 13:12
systay added 3 commits April 12, 2021 15:13
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay force-pushed the gen4-table-aliases branch from 619a11d to 18e61f0 Compare April 12, 2021 13:14
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
@frouioui frouioui force-pushed the gen4-table-aliases branch from cfcb83a to 481e317 Compare April 15, 2021 08:34
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
@systay systay marked this pull request as ready for review April 15, 2021 13:59
@systay systay requested a review from GuptaManan100 April 15, 2021 14:02
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Comment on lines +49 to +52
keyspace, err := vschema.DefaultKeyspace()
if err != nil {
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

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

this will start failing for cases when there is no default database selected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmm... how come no tests are failing? do we need to add more tests to the planner?

you are probably absolutely correct about this comment. that being said - since this is not failing any tests, how about we take care of this in a separate PR? We should add more tests, and then also fix the issue

WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I think we are introducing this check here, so it be be better to have a test that covers the error case if existing tests do not fail.

go/vt/vtgate/semantics/analyzer.go Outdated Show resolved Hide resolved
systay added 2 commits April 26, 2021 12:07
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay force-pushed the gen4-table-aliases branch from b13224c to 18036f5 Compare April 26, 2021 10:51
@harshit-gangal
Copy link
Member

CI tests are failing.

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay added Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Apr 26, 2021
@systay systay merged commit 7e13d4b into vitessio:master Apr 27, 2021
@systay systay deleted the gen4-table-aliases branch April 27, 2021 10:21
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