I'm using cassandra. I am trying to update the gc_grace
value using new bind variable.
ALTER table keyspace.table_name with gc_grace_seconds = ? ;
I got the following error:
no viable alternative at input '?'
How can I solve this?
I'm using cassandra. I am trying to update the gc_grace
value using new bind variable.
ALTER table keyspace.table_name with gc_grace_seconds = ? ;
I got the following error:
no viable alternative at input '?'
How can I solve this?
It looks like you're trying to bind parameters programatically to set GC grace on a table. It isn't possible to do that using the Cassandra drivers.
It will only work through cqlsh. For example:
cqlsh> ALTER TABLE community.maptbl WITH gc_grace_seconds = 3600;
It doesn't make sense to do it in your app and it is not recommended. Cheers!
As I see from the source code (maybe I'm wrong), but
ALTER TABLE
doesn't support bindings, so you can't use them for this command (and all DDL commands), and need to just useexecute
with specific value