nva commented on code in PR #2882:
URL: https://github.com/apache/ignite-3/pull/2882#discussion_r1433750980
##########
modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientRecordBinaryView.java:
##########
@@ -380,4 +392,36 @@ public CompletableFuture<Void> streamData(Publisher<Tuple>
publisher, @Nullable
return ClientDataStreamer.streamData(publisher, opts, batchSender,
provider, tbl);
}
+
+ private CompletableFuture<AsyncResultSet<Tuple>> executeAsync(
+ @Nullable Transaction tx,
+ @Nullable Criteria criteria,
+ CriteriaQueryOptions opts
+ ) {
+ //TODO: implement serialization of criteria to SQL
https://issues.apache.org/jira/browse/IGNITE-20879
+ var query = "SELECT * FROM " + tbl.name();
+
+ Statement statement = new
ClientStatementBuilder().query(query).pageSize(opts.pageSize()).build();
+ Session session = new ClientSessionBuilder(tbl.channel()).build();
+
+ return session.executeAsync(tx, statement)
+ .thenApply(resultSet -> new
QueryCriteriaAsyncResultSet<>(resultSet, session::close));
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ClosableCursor<Tuple> queryCriteria(@Nullable Transaction tx,
@Nullable Criteria criteria, CriteriaQueryOptions opts) {
+ return new SyncResultSetAdapter<>(executeAsync(tx, criteria,
opts).join());
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public CompletableFuture<AsyncClosableCursor<Tuple>> queryCriteriaAsync(
+ @Nullable Transaction tx,
+ @Nullable Criteria criteria,
+ CriteriaQueryOptions opts
+ ) {
+ return executeAsync(tx, criteria, opts)
+ .thenApply(Function.identity());
Review Comment:
Removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]