-
Notifications
You must be signed in to change notification settings - Fork 40
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
Predicate Filtering #78
Comments
If you are blocked by this, would you be willing to consider taking a stab at implementing predicate filtering support and submitting a pull request? I could give you some pointers to get you started. |
Yes, I really need this, so I am interested. |
The Aerospike Ruby client is largely modeled after the Java client, so that would be the best reference: aerospike/aerospike-client-java@b6355f5 |
I am trying to understand, does Predicate expression filter uses same query method but predex is defined before execution? I mean this one Or do we need to implement something like where and then predex filter would go as argument? |
The interface for using predicate expressions would look something like this: require 'aerospike'
include Aerospike
client = Client.new()
stmt = Statement.new("namespace", "set")
stmt.filters << Filter.Equal('bin1', 'foo')
stmt.predexp = [
PredExp.stringBin('bin2'),
PredExp.stringValue('bar'),
PredExp.stringEqual(),
PredExp.integerBin('bin3'),
PredExp.integerValue(42),
PredExp.integerGreater(),
PredExp.and(2)
]
rs = client.query(stmt)
rs.each do |rec|
puts rec
end This example executes a query that uses the secondary index on "bin1" to find all records where "bin1" equals "foo". It then further narrows down the results to only return records that match the predicate expression "(bin2 == 'bar') && (bin3 > 42)". You use the same To implement this, you would have to create a new The Java client code can be used as reference for both the pieces. |
Hi,
since ruby client does not support AGGREGATE query, and, it seems it will not in some time, it is necessary to implement Predicate Filtering so you could filter with more than one index
https://www.aerospike.com/docs/guide/predicate.html
Thank you
Dorijan
The text was updated successfully, but these errors were encountered: