-
Notifications
You must be signed in to change notification settings - Fork 20
CNDB-16020: CNDB-15760: Fix AbstractReadQuery.toCQLString #2148
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
Conversation
Checklist before you submit for review
|
d69c6b2 to
fd01f53
Compare
| operator = first.endInclusive ? Operator.LTE : Operator.LT; | ||
| sb.append(' ').append(operator).append(' ') | ||
| .append(column.type.toCQLString(first.endValue)); | ||
| rowFilter = rowFilter.without(column, operator, first.endValue); |
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 @adelapena
in CASSANDRA-16510 you introduced rowFilter parameter to toCQLString()
and in Slices.ArrayBackedSlices.toCQLString() many rowFilter = rowFilter.without(…) lines.
( like the one highlighted )
but in CNDB-15760
0c97397
when you introduced the rowFilter parameter you didn't add those rowFilter = rowFilter.without(…) lines…
should they be there or not… ?
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.
They should be there. Those rowFilter.withoutFirstLevelExpression calls are there to address a problem of duplicated expressions in the output of toCQLString that I think only happens with index-based ORDER BY. That feature doesn't exist on ASF, so it shouldn't be an issue there.
There are repro tests for ClusteringIndexNamesFilter, but unfortunately I missed to add one for Slices. Here is one:
assertToCQLString("SELECT * FROM %s WHERE k = 0 AND c > 0 ORDER BY n LIMIT 10",
"SELECT * FROM %s WHERE k = 0 AND c > 0 ORDER BY n ASC LIMIT 10 ALLOW FILTERING",
"SELECT * FROM %s WHERE k = ? AND c > ? ORDER BY n ASC LIMIT 10 ALLOW FILTERING");
If we didn't have the without call in the slices, it would have wrongly returned:
SELECT * FROM %s WHERE k = 0 AND c > 0 AND c > 0 ORDER BY n ASC LIMIT 10 ALLOW FILTERING
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.
added in bed2448
|
Fix AbstractReadQuery.toCQLString to produce output that is as close to valid CQL as possible. The fixes here mainly come from CASSANDRA-16510, and there is also some removal of code duplication.
bed2448 to
9629caf
Compare
❌ Build ds-cassandra-pr-gate/PR-2148 rejected by Butler1 regressions found Found 1 new test failures
Found 7 known test failures |



https://github.com/riptano/cndb/issues/16020
Port into main-5.0 commit 0c97397