Abacn commented on code in PR #24830:
URL: https://github.com/apache/beam/pull/24830#discussion_r1059434802


##########
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java:
##########
@@ -485,6 +489,39 @@ public void testReadWithQuery() throws Exception {
     pipeline.run();
   }
 
+  @Test
+  public void testReadWithUnfilteredQuery() throws Exception {
+    String query =
+        String.format(
+            "select person_id, writetime(person_name) from %s.%s",
+            CASSANDRA_KEYSPACE, CASSANDRA_TABLE);
+
+    PCollection<Scientist> output =
+        pipeline.apply(
+            CassandraIO.<Scientist>read()
+                .withHosts(Collections.singletonList(CASSANDRA_HOST))
+                .withPort(cassandraPort)
+                .withKeyspace(CASSANDRA_KEYSPACE)
+                .withTable(CASSANDRA_TABLE)
+                .withMinNumberOfSplits(20)
+                .withQuery(query)
+                .withCoder(SerializableCoder.of(Scientist.class))
+                .withEntity(Scientist.class));
+
+    PAssert.thatSingleton(output.apply("Count", 
Count.globally())).isEqualTo(22L);

Review Comment:
   ```suggestion
       PAssert.thatSingleton(output.apply("Count", 
Count.globally())).isEqualTo(NUM_ROWS);
   ```



##########
CHANGES.md:
##########
@@ -80,7 +80,7 @@
 
 ## Bugfixes
 
-* Fixed X (Java/Python) ([#X](https://github.com/apache/beam/issues/X)).
+* Avoids Cassandra syntax error when user-defined query has no where clause in 
it (Java/Python) ([#24829](https://github.com/apache/beam/issues/24829)).

Review Comment:
   ```suggestion
   * Avoids Cassandra syntax error when user-defined query has no where clause 
in it (Java) ([#24829](https://github.com/apache/beam/issues/24829)).
   ```



-- 
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]

Reply via email to