Skip to content

Commit

Permalink
FMWK-274 Set bin names in secondary index query (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn authored Dec 5, 2023
1 parent 018e1b0 commit dd2ff23
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ public RecordSet execute(QueryPolicy queryPolicy, AerospikeQuery query,
statement.setIndexName(secondaryIndex.getIndexName());
statement.setNamespace(query.getSchema());
statement.setSetName(query.getTable());
statement.setBinNames(query.columnBins());

if (Objects.nonNull(query.getPredicate())) {
query.getPredicate().toFilter(secondaryIndex.getBinName()).ifPresent(statement::setFilter);
}

if (query.isPrimaryKeyOnly()) {
queryPolicy.includeBinData = false;
}
client.query(EventLoopProvider.getEventLoop(), listener, queryPolicy, statement);

return listener.getRecordSet();
Expand Down

0 comments on commit dd2ff23

Please sign in to comment.