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

Cherry-pick fix for offset not working with multiple order statements into release/v1.0 #3455

Merged
merged 2 commits into from
May 21, 2019

Conversation

pawanrawal
Copy link
Contributor

@pawanrawal pawanrawal commented May 21, 2019

This change is Reviewable

…nts. (#3400)

Multisort happens in two stages.

In the first stage the uids are sorted by the first predicate and
In the second stage the other sorts are executed with the ids that are the output from the first stage.
While considering the uids that are input for the second stage, we must also consider uids with equal values at the boundary where offset/count is applied. This was being done for count but not for offset.

This PR adds multiSortOffsets to sortResult which keeps track of the pending offset (which would be <= offset in the query). The multiSortOffset must be applied to individual uid lists after all the sorts are done.
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @pawanrawal)


query/query1_test.go, line 1883 at r1 (raw file):

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			js := processQueryNoErr(t, tt.query)

change this to processToFastJsonNoErr

Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pawanrawal)

@pawanrawal pawanrawal merged commit f24d2da into release/v1.0 May 21, 2019
@pawanrawal pawanrawal deleted the pawanrawal/cp-multiorder-offset branch May 24, 2019 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants