-
Notifications
You must be signed in to change notification settings - Fork 53
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
Using GoLang v1.19 cid ordering is changed due to unstable sort #1071
Labels
area/query
Related to the query component
bug
Something isn't working
code quality
Related to improving code quality
Milestone
Comments
shahzadlone
added
bug
Something isn't working
area/query
Related to the query component
code quality
Related to improving code quality
labels
Feb 2, 2023
shahzadlone
changed the title
Using GoLang v1.19 some commit ordering is changed
Using GoLang v1.19 cid ordering is changed due to unstable sort
Feb 14, 2023
The situation was that
Both the above sorts return different ordering, this is because we are using unstable sort. The correct ordering that should pass with both GoLang 1.18.5 and 1.19.5 is the following (the order should be preserved):
|
4 tasks
shahzadlone
added a commit
that referenced
this issue
Feb 15, 2023
- Resolves #1071 - Resolves #921 - This change uses stable sort and ensures the `Less` interface implementation only returns true if the comparison is less, otherwise returns false (this is not the full story as for when we do `DESC` the less to us then is the check of if it's greater than instead of less than). Note: Ensures the ordering of the input array is preserved, so the output is always stable. - This change works on both GoLang v1.18.5 and v1.19.5. - This also resolves some nil panics we were having before (one subtask of #833, which is issue #921). 1) Fixes the test: `TestOneToManyToOneDeepOrderBySubTypeOfBothDescAndAsc` 2) Fixes the test: `TestOneToManyToOneWithSumOfDeepOrderBySubTypeAndDeepOrderBySubtypeAscDirections` - Ensures our sort handles `nil` sorting properly for `ASC` and `DESC`: ``` DESC = [10, 9, 8, ... nil, nil] ASC = [nil, nil, 1, 2, 3, ... ] ```
shahzadlone
added a commit
that referenced
this issue
Apr 13, 2023
- Resolves #1071 - Resolves #921 - This change uses stable sort and ensures the `Less` interface implementation only returns true if the comparison is less, otherwise returns false (this is not the full story as for when we do `DESC` the less to us then is the check of if it's greater than instead of less than). Note: Ensures the ordering of the input array is preserved, so the output is always stable. - This change works on both GoLang v1.18.5 and v1.19.5. - This also resolves some nil panics we were having before (one subtask of #833, which is issue #921). 1) Fixes the test: `TestOneToManyToOneDeepOrderBySubTypeOfBothDescAndAsc` 2) Fixes the test: `TestOneToManyToOneWithSumOfDeepOrderBySubTypeAndDeepOrderBySubtypeAscDirections` - Ensures our sort handles `nil` sorting properly for `ASC` and `DESC`: ``` DESC = [10, 9, 8, ... nil, nil] ASC = [nil, nil, 1, 2, 3, ... ] ```
shahzadlone
added a commit
to shahzadlone/defradb
that referenced
this issue
Feb 23, 2024
- Resolves sourcenetwork#1071 - Resolves sourcenetwork#921 - This change uses stable sort and ensures the `Less` interface implementation only returns true if the comparison is less, otherwise returns false (this is not the full story as for when we do `DESC` the less to us then is the check of if it's greater than instead of less than). Note: Ensures the ordering of the input array is preserved, so the output is always stable. - This change works on both GoLang v1.18.5 and v1.19.5. - This also resolves some nil panics we were having before (one subtask of sourcenetwork#833, which is issue sourcenetwork#921). 1) Fixes the test: `TestOneToManyToOneDeepOrderBySubTypeOfBothDescAndAsc` 2) Fixes the test: `TestOneToManyToOneWithSumOfDeepOrderBySubTypeAndDeepOrderBySubtypeAscDirections` - Ensures our sort handles `nil` sorting properly for `ASC` and `DESC`: ``` DESC = [10, 9, 8, ... nil, nil] ASC = [nil, nil, 1, 2, 3, ... ] ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/query
Related to the query component
bug
Something isn't working
code quality
Related to improving code quality
This is what commit ordering looks like with GoLang v1.18.5:
This is what commit ordering looks like with GoLang v1.19.5:
The text was updated successfully, but these errors were encountered: