//Read data from Cassandra
String query = "SELECT * FROM LABA_2.DATA LIMIT 5;";
//Creating Cluster object
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
//Creating Session object
Session session = cluster.connect();
//Getting the ResultSet
ResultSet result = session.execute(query);
System.out.println(result.all().size());
System.out.println("AJFGJKABGSDKGJS");
System.out.println(result.all().size());
System.out.println("AJFGJKABGSDKGJS");
Output:
22/04/02 23:11:56 INFO Cluster: New Cassandra host /127.0.0.1:9042 added
5
AJFGJKABGSDKGJS
0
AJFGJKABGSDKGJS
In the first case size = 5, in the second = 0.
cassandra-driver - 3.11.0
Why results are different?