Implement the collector API
Closed this issue · 2 comments
Sammers21 commented
With the collector API, such thing should be possible:
// Create a collector projecting a row set to a (last_name_1,last_name_2,...)
Collector<Row, ?, String> collector = Collectors.mapping(
row -> row.getString("last_name"),
Collectors.joining(",", "(", ")")
);
// Run the query with the collector
client.execute("SELECT * FROM users",
collector,
ar -> {
if (ar.succeeded()) {
String result = ar.result();
System.out.println("Got " + result);
} else {
System.out.println("Failure: " + ar.cause().getMessage());
}
});
tsegismont commented
@Sammers21 can you look into this for 3.7 ?
Sammers21 commented
Sure