-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
CASSANDRA-20295 trunk fix min/max aggregation on reversed types #3872
base: trunk
Are you sure you want to change the base?
Conversation
5a6291b
to
237eaba
Compare
237eaba
to
4458c6d
Compare
if (value == null) | ||
return; | ||
|
||
if (returnType.isReversed()) |
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.
can you explain why this is needed vs returnType.unwrap()
? If we are comparing we are just reversing the compare, so if we did returnType.unwrap()
couldn't we avoid all this?
execute("INSERT INTO %s (a, b) VALUES (2, 100)"); | ||
execute("INSERT INTO %s (a, b) VALUES (4, 1)"); | ||
|
||
assertRows(execute("SELECT count(b), min(b) as max FROM %s"), |
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.
assertRows(execute("SELECT count(b), min(b) as max FROM %s"), | |
assertRows(execute("SELECT count(b), min(b) as min FROM %s"), |
execute("INSERT INTO %s (a, b) VALUES (2, 100)"); | ||
execute("INSERT INTO %s (a, b) VALUES (4, 1)"); | ||
|
||
assertRows(execute("SELECT count(b), min(b) as max FROM %s"), |
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.
assertRows(execute("SELECT count(b), min(b) as max FROM %s"), | |
assertRows(execute("SELECT count(b), min(b) as min FROM %s"), |
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.
my main question is why the refactor doesn't do returnType.unwrap()
and ignore all the complexity of reverse types. Im all for the refactor as i don't like copy/paste code, but the actual core part of the patch to address this I feel could be simplified, and mostly just wonder if there is a motivating reason to avoid .unwrap()
?
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira