-
Notifications
You must be signed in to change notification settings - Fork 873
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-19931: Support OR operator and sub-conditions in query builder #1965
base: 4.x
Are you sure you want to change the base?
Conversation
.where(Relation.column("m").isEqualTo(literal(3)))) | ||
.orderBy("c1", ASC) | ||
.orderBy("c2", DESC)) | ||
.hasCql("SELECT * FROM foo WHERE k=1 AND (l=2 OR m=3) ORDER BY c1 ASC,c2 DESC"); |
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.
If I understand correctly, this a 'recursive' building.
So we can have
SELECT * FROM foo WHERE k=1 AND (l=2 OR m=3 OR (q=4 AND p=5 )) ORDER BY c1 ASC,c2 DESC"
Or other complex nested logical query?
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.
Yes, you are correct. I have made one of the queries more complex.
.orderBy("c1", ASC) | ||
.orderBy("c2", DESC)) | ||
.hasCql("SELECT * FROM foo WHERE k=1 AND (l=2 OR m=3) ORDER BY c1 ASC,c2 DESC"); | ||
} |
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.
Is it possible we can add some more complex logical query in tests.
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.
Replaced last test to be more complex. Above tests also verify backward-compatibility of current default AND
operator.
Fix CASSANDRA-19931.
Example OR operator:
Example sub-condition: