A user had a table with a timestamp
column like this:
CREATE TABLE comments ( comment_id text, username text, comment_time timestamp, PRIMARY KEY (comment_id) )
Attempts to insert a value using QueryBuilder.now()
:
preparedInsert = session.prepare(QueryBuilder .insertInto(ks_name, table_name) .value("comment_id", QueryBuilder.bindMarker()) .value("username", QueryBuilder.bindMarker()) .value("comment_time", QueryBuilder.now()) );
results in the following exception:
com.datastax.driver.core.exceptions.InvalidQueryException: Type error: cannot assign result of function system.now (type timeuuid) to update_time (type timestamp)
What is the syntax for inserting a timestamp?