Sreekanth P
Sreekanth P

Reputation: 1227

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?.

Upvotes: 1

Views: 235

Answers (1)

Alex Ott
Alex Ott

Reputation: 87119

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

Upvotes: 2

Related Questions