cassandradatastax-java-driverspring-data-cassandracassandra-4.0

What do I map varchar type to with Cassandra Java driver 4.13.0?


as part of the Cassandra driver migration, I need to migrate a codec registration like bellow.

TupleType tupleType =  cluster.getMetadata().newTupleType(
    DataType.timestamp(), DataType.varchar());

cluster.getConfiguration().getCodecRegistry().register(
   new ZonedDateTimeCodec(tupleType));

I am not able to find the varchar type in com.datastax.oss.driver.api.core.type.DataTypes

TupleType tupleType = DataTypes.tupleOf(DataTypes.TIMESTAMP, 
   DataTypes.need-varchar-type)

Can u pls suggest what can I do for this mapping?.


Solution

  • varchar is the same as the text data type, so you can use TEXT DataType