Following is the sample definition of the Cassandra table I have; CREATE TABLE IF NOT EXISTS test_table (
id int,
data_date date,
score double,
PRIMARY KEY (id)
);
I have created a TestTable Class which extends Serializable
and the member dataDate
data type has been defined as com.datastax.driver.core.LocalDate
.
However when I try writing this data using CassandraIO.write I face the error
Caused by: java.io.NotSerializableException: com.datastax.driver.core.LocalDate
I Understand this error is because com.datastax.driver.core.LocalDate doesn't implement Serializable
interface
Hence I tried changing the data type of the member dataDate
to java.time.LocalDate
However this change results in the error
java.lang.RuntimeException:org.apache.beam.sdk.util.UserCodeException:java.util.concurrent.ExecutionException:
com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [date <-> java.time.LocalDate]
So the question is; if I have a column of datatype date in Cassandra, how do I insert it using Apache Beam's CassandraIO