-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fix DISTINCT
over DECIMALS
#2330
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
sql/expression/distinct.go
Outdated
@@ -31,16 +33,36 @@ func (de *DistinctExpression) seenValue(ctx *sql.Context, value interface{}) (bo | |||
de.dispose = dispose | |||
} | |||
|
|||
hash, err := hashstructure.Hash(value, nil) | |||
// TODO: how to handle nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring might be helpful, I'm assuming nil doesn't hash so we need to keep a variable for it? Should the close function set seenNil
back to false in case the expression is reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep nil
can't be hashed; I definitely need to set seenNil
back to false in Dispose()
method. Will fix!
There was another place where we were using
hashstructure
package, which does not hashdecimal.Decimal
types correctly.Switched to
xxhash
package, which is what we use everywhere else.Reusing solution from: #2279
This will fix 1 sqllogictest.