-
Notifications
You must be signed in to change notification settings - Fork 43
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
Switch to scylla 6.2 #397
Switch to scylla 6.2 #397
Conversation
3eacd55
to
8483fa0
Compare
8483fa0
to
d655cb6
Compare
8d48572
to
f7b7995
Compare
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.
Looks quite good now!
Nit (you can ignore it): First commit should actually be last to keep the tests passing on each commit.
cassandra/cqlengine/query.py
Outdated
|
||
for col_name in colnames: | ||
col_name, order = self._get_ordering_condition(col_name) | ||
col_name = '"{0}"'.format(col_name) | ||
# Check if there is existing condition that targets same column and replace it if it's order is different | ||
for cond_id, existing_condition in enumerate(clone._order): | ||
if col_name in existing_condition: | ||
if not existing_condition.endswith(order): | ||
clone._order[cond_id] = '{0} {1}'.format(col_name, order) | ||
break | ||
else: | ||
clone._order.append('{0} {1}'.format(col_name, order)) |
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.
Question regarding commit "Fix AbstractQuerySet.order_by to consider existing conditions ":
The root cause of the problem is that Scylla handles such weird queries differently than Cassandra, right? If so, could you add a comment on this code that explains it?
Note: I know nothing about cqlengine code so I don't feel competent to review it and I don't feel like I understand the change. @fruch can you take a look?
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.
this fix not related to cqlengine per se,
seems it cover from some mismatch between scylla and cassandra
it's weird a bit, cassandra accepts this ? what the CQL spec say about it ?
seems not much:
https://cassandra.apache.org/doc/4.0/cassandra/cql/dml.html#ordering-clause
I think we should raise it as issue in scylla, and mark it as compatibility issue with cassandra
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.
That's something the server should be doing/guarding, but for the meanwhile, it's seems o.k. to me that that cqlengine would prevent it.
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.
Problem is that scylla does that and fails the query with multiple records of the same column in order by
while cassandra ignores it and goes with order mentioned last.
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.
Problem is that scylla does that and fails the query with multiple records of the same column in
order by
while cassandra ignores it and goes with order mentioned last.
And that fix makes cqlengine avoid creating such queries, so they are basically ignored like in cassandra, even when executing on Scylla?
Is it the right thing to do here? It fixes the test, but isn't the Scylla behavior better for the user (failing early rather than somehow executing it)?
What do you think about changing / xfailing the test instead?
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.
And that fix makes cqlengine avoid creating such queries, so they are basically ignored like in cassandra, even when executing on Scylla? Is it the right thing to do here?
Yes.
It fixes the test, but isn't the Scylla behavior better for the user (failing early rather than somehow executing it)?
Yes, I think scylla behavior is more correct, it does not make sense to have opposite ordering direction for the same column.
What do you think about changing / xfailing the test instead?
As far as understand this test, this is cqlengine
test for order_by
functionality that generates one query executes it and then reverse order direction and executes it again, so it should work just fine.
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.
Ok, after thinking about it just a bit, I decided to fix the test instead, commit is dropped.
f7b7995
to
17cf722
Compare
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
Scylla does not support bucket_low higher than 1 At the same time cassandra is ok with from 0 to 10
17cf722
to
05cbf94
Compare
Scylla does not support statement with opposite ordering direction for the same collumn: SELECT * FROM table ORDER BY a ASC, a DESC;
Pre-review checklist
./docs/source/
.Fixes:
annotations to PR description.