0

I am trying to read Data from Cassandra db using apache beam CassandraIO , my requirement is crating a Pcollection of Rows from cassandra db , currently my code look like this

PTransform<PBegin,PCollection<Row>>transform=CassandraIO.<Row>read()
   .withHosts(Collections.singletonList("127.0.0.1"))
   .withPort(9042)
   .withKeyspace("\"testDb\"")
   .withMapperFactoryFn(new CassandraRowMapper())
   .withQuery(q)
   .withTable("student")
   .withEntity(Row.class)
   .withCoder(SerializableCoder.of(Row.class));

any help will be appreciated

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
bforblack
  • 65
  • 5
  • what is the problem? do you get any error, etc.? – Alex Ott Jul 29 '20 at 06:39
  • hi @AlexOtt the problem is beam CassandraIO is expecting an entity class in entity method and I am trying to access the rows directly so that i can have a Pcollection apart from Pcollection – bforblack Jul 29 '20 at 09:25

0 Answers0