Ask Your Question
0

cassandra_06 - could not prepare record id due to: com.datastax.driver.core.exceptions.codecnotfoundexception: codec not found for requested operation: [int <-> java.lang.string]

asked 2018-12-11 02:23:57 -0600

Tutgirl gravatar image

updated 2018-12-11 02:25:03 -0600

I'm using default Cassandra available in Streamsets. Im trying to insert records from csv into Cassandra which has a date field.

The value for this Cassandra date field from CSV is 201812061035234, which I'm converting to a long and then to String of following format: yyyy-MM-dd'T'HH:mm:ss.SSS Z and Im getting below error:

CASSANDRA_06 - Could not prepare record id'/*/_201812061035234.csv::1544076300000::0::3396' due to: com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [int <-> java.lang.String]

Thanks in Advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-12-11 02:59:11 -0600

iamontheinet gravatar image

Hi!

Codec not found for requested operation: [int <-> java.lang.String] means there's no built-in codec that maps a CQL Int to java.lang.String. Use Field Type Converter to perform the conversion.

Cheers, Dash

edit flag offensive delete link more

Comments

Thanks, I have done it for integer. In cassandra I have some bigint fields. But I could not find big int conversion in Field Type Converter. Could you please tell me how to do that?

Tutgirl gravatar imageTutgirl ( 2018-12-11 03:44:20 -0600 )edit

Long type worked for that.

Tutgirl gravatar imageTutgirl ( 2018-12-11 04:07:17 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-12-11 02:23:57 -0600

Seen: 134 times

Last updated: Dec 11 '18