-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Zachmu/analyzer #88
Zachmu/analyzer #88
Conversation
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
…ve columns Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
…their own file Signed-off-by: Zach Musgrave <zach@liquidata.co>
…rywhere Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
…ary table key expressions in the order specified by the secondary index. Signed-off-by: Zach Musgrave <zach@liquidata.co>
…aliases. Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
…one of two broken tests Signed-off-by: Zach Musgrave <zach@liquidata.co>
…nation and ordering, for correctness and query plan. Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
…that weren't adding anything Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Pretty well tested, but take a quick look for any obvious problems. |
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.
lgtm
@@ -76,7 +77,7 @@ func TestMisusedAlias(t *testing.T) { | |||
} | |||
|
|||
func TestQualifyColumns(t *testing.T) { | |||
require := require.New(t) |
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.
Don't have an issue with this... but why the preference for assert in this case?
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.
require stops the test on the first failed check, assert lets it continue.
sql/analyzer/resolve_columns.go
Outdated
for _, col := range child.Schema() { | ||
childSch := child.Schema() | ||
for _, col := range childSch { | ||
// columns of tables with an alias can be referred to either by their aliased or unaliased name, so add an entry |
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.
sentence is wordy and hard to read. Maybe take out the word "either".
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.
Done.
sql/analyzer/analyzer.go
Outdated
Debug bool | ||
// Whether to output the query plan at each step of the analyzer | ||
Verbose bool | ||
debugCtx []string |
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.
Reading the code below I had to scroll back up to see what debugCtx was. I read Ctx and think context.Context. Feel like another name would clear up some confusion.
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.
Done
sql/analyzer/fix_field_indexes.go
Outdated
return result, nil | ||
} | ||
|
||
// fixFieldIndexes transforms the given expression setting correct indexes |
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.
"the given expression setting correct indexes for GetField"
wat?
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.
Done
Signed-off-by: Zach Musgrave <zach@liquidata.co>
Analyzer improvements, mostly related to treatment of aliases to support selecting the same table twice, but lots of other improvements as well.