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

Fixed bug in field indexes related to pushdown of indexes in subqueries #430

Merged
merged 8 commits into from
May 25, 2021

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented May 25, 2021

No description provided.

Copy link
Contributor

@andy-wm-arthur andy-wm-arthur left a comment

Choose a reason for hiding this comment

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

LGTM, seems worth revisiting as the column index mappings are gathering complexity

@@ -173,29 +174,29 @@ func replaceTableAccessWithIndexedAccess(
}

// the condition's field indexes might need adjusting if the order of tables changed
cond, err := FixFieldIndexes(scope, append(schema, append(left.Schema(), right.Schema()...)...), node.Cond)
cond, err := FixFieldIndexes(scope, nil, append(schema, append(left.Schema(), right.Schema()...)...), node.Cond)
Copy link
Contributor

Choose a reason for hiding this comment

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

intended nil?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, good catch

), nil
newIndex := scopeLen - offset + i
if e.Index() != newIndex {
a.Log("Rewriting field %s.%s from index %d to %d", e.Table(), e.Name(), e.Index(), newIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like a lot of threading to get the log statement here

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, eventually we need to put the logger in the session or something

@zachmu zachmu merged commit 4590c31 into master May 25, 2021
@Hydrocharged Hydrocharged deleted the zachmu/ntc-query-bug branch December 8, 2021 07:08
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.

2 participants