0

When we trying delete using Cassandra.Mapping.Delete<T> method the application throws an error on execution:

enter image description here

This is a 'Entity(POCO)' class on application:

enter image description here

Table structure in Cassandra database:

enter image description here

Complete exception description:

An exception of type 'Cassandra.SyntaxError' occurred in System.Private.CoreLib.dll but was not handled in user code: 'line 0:-1 no viable alternative at input '''

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Cassandra.Requests.PrepareHandler.d__6.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Cassandra.Requests.PrepareHandler.d__4.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Cassandra.Session.d__54.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Cassandra.Mapping.Statements.StatementFactory.d__8.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Cassandra.Mapping.Mapper.d__38.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Cassandra.Tasks.TaskHelper.WaitToComplete(Task task, Int32 timeout)

What is wrong?

FYI: these links don't solve this problem:

S.O: "no viable alternative at input" error when querying cassndra table

S.O: Cassandra "no viable alternative at input"

[SOLVED]

Thanks @jorgebg, we forgotten to specify the partition key on "Entity" mapping class.

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Igor
  • 3,573
  • 4
  • 33
  • 55
  • 1
    Have you tried specifying the partition key in your mappings? https://docs.datastax.com/en/developer/csharp-driver/3.6/features/components/mapper/#configuring-mappings – jorgebg Jul 19 '18 at 12:56
  • You are the man! Sorry for this! – Igor Jul 19 '18 at 13:19

0 Answers0