vert-x3/vertx-cassandra-client

Implement the collector API

Closed this issue · 2 comments

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());
   }
});

@Sammers21 can you look into this for 3.7 ?

Sure