Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ private List<Struct> executeQuery(long expectedCount, String stmt) {
List<Struct> rows = new ArrayList<>();
final TransactionCallable<Void> callable =
transaction -> {
// Make sure we start with an empty list if the transaction is aborted and retried.
rows.clear();
ResultSet resultSet = transaction.executeQuery(Statement.of(stmt));
// resultSet.next() returns false, when no more row exists.
// So, number of times resultSet.next() returns true, is the number of rows
Expand Down Expand Up @@ -335,6 +337,7 @@ private List<Struct> executeQueryAsync(long expectedCount, String stmt) {
List<Struct> rows = new ArrayList<>();
final TransactionCallable<Void> callable =
transaction -> {
rows.clear();
AsyncResultSet rs = transaction.executeQueryAsync(Statement.of(stmt));
rs.setCallback(
Executors.newSingleThreadExecutor(),
Expand Down
Loading