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

distsqlrun: fix lookup join with limit #30819

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

jordanlewis
Copy link
Member

@jordanlewis jordanlewis commented Oct 1, 2018

Previously, lookup join used its processRowHelper in an inappropriate
place (not directly before returning a row) which caused the final rows
in a limit query to get omitted in certain cases. Correct this problem.

Fixes #30812.

Release note (bug fix): lookup joins no longer omit rows in certain
circumstances during limit queries.

@jordanlewis jordanlewis requested review from solongordon, asubiotto and a team October 1, 2018 13:14
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)


pkg/sql/distsqlrun/joinreader.go, line 536 at r1 (raw file):

// emitRow returns the next row from jr.toEmit, if present. Otherwise it
// prepares for another input batch.
func (jr *joinReader) emitRow() (joinReaderState, sqlbase.EncDatumRow, *ProducerMetadata) {

[nit] remove the last return which is always nil

Copy link
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

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

:lgtm: You could also consider applying ProcessRowHelper at the end of Next() just to be more consistent with other processors like hashjoiner.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

Previously, lookup join used its processRowHelper in an inappropriate
place (not directly before returning a row) which caused the final rows
in a limit query to get omitted in certain cases. Correct this problem.

Release note (bug fix): lookup joins no longer omit rows in certain
circumstances during limit queries.
Copy link
Member Author

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Good idea, done.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale)

@jordanlewis
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Oct 1, 2018
30819: distsqlrun: fix lookup join with limit r=jordanlewis a=jordanlewis

Previously, lookup join used its processRowHelper in an inappropriate
place (not directly before returning a row) which caused the final rows
in a limit query to get omitted in certain cases. Correct this problem.

Fixes #30812.

Release note (bug fix): lookup joins no longer omit rows in certain
circumstances during limit queries.

Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
@craig
Copy link
Contributor

craig bot commented Oct 1, 2018

Build succeeded

@craig craig bot merged commit 7ba018c into cockroachdb:master Oct 1, 2018
@jordanlewis jordanlewis deleted the fix-lj-limit branch October 1, 2018 19:02
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.

select with limit not working correctly
4 participants