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

Zachmu/analyzer #88

Merged
merged 34 commits into from
Apr 21, 2020
Merged

Zachmu/analyzer #88

merged 34 commits into from
Apr 21, 2020

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Apr 17, 2020

Analyzer improvements, mostly related to treatment of aliases to support selecting the same table twice, but lots of other improvements as well.

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>
Signed-off-by: Zach Musgrave <zach@liquidata.co>
@zachmu zachmu requested a review from bheni April 17, 2020 21:50
@zachmu
Copy link
Member Author

zachmu commented Apr 17, 2020

Pretty well tested, but take a quick look for any obvious problems.

Copy link
Contributor

@bheni bheni left a 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)
Copy link
Contributor

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?

Copy link
Member Author

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.

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
Copy link
Contributor

@bheni bheni Apr 20, 2020

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".

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Debug bool
// Whether to output the query plan at each step of the analyzer
Verbose bool
debugCtx []string
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

return result, nil
}

// fixFieldIndexes transforms the given expression setting correct indexes
Copy link
Contributor

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?

Copy link
Member Author

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>
@zachmu zachmu merged commit afa5b35 into ld-master Apr 21, 2020
@Hydrocharged Hydrocharged deleted the zachmu/analyzer branch April 23, 2020 18:39
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