Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10684

cassandra-stress not working with PRIMARY KEY containing 2 columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Low
    • Resolution: Unresolved
    • 2.1.x
    • Legacy/Tools
    • None
    • Low

    Description

      Running the following command with attached yaml file

      ./cassandra-stress user profile=request_trace_2.yaml o(likelyquery0=1,likelyquery1=2,insert=1) -node 127.0.0.1

      Getting the following error:

      Generating batches with [1..1] partitions and [0..0] rows (of [1..1] total rows in the partitions)
      Exception in thread "main" java.lang.RuntimeException: InvalidRequestException(why:line 1:28 no viable alternative at input 'WHERE' (UPDATE "request_trace" SET [WHERE] service_context_id...))
      at org.apache.cassandra.stress.StressProfile.getInsert(StressProfile.java:382)
      at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:82)
      at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(SettingsCommandUser.java:78)
      at org.apache.cassandra.stress.operations.SampledOpDistributionFactory$1.get(SampledOpDistributionFactory.java:78)
      at org.apache.cassandra.stress.StressAction$Consumer.<init>(StressAction.java:269)
      at org.apache.cassandra.stress.StressAction.run(StressAction.java:204)
      at org.apache.cassandra.stress.StressAction.warmup(StressAction.java:105)
      at org.apache.cassandra.stress.StressAction.run(StressAction.java:61)
      at org.apache.cassandra.stress.Stress.main(Stress.java:109)
      Caused by: InvalidRequestException(why:line 1:28 no viable alternative at input 'WHERE' (UPDATE "request_trace" SET [WHERE] service_context_id...))
      at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result$prepare_cql3_query_resultStandardScheme.read(Cassandra.java:52282)
      at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result$prepare_cql3_query_resultStandardScheme.read(Cassandra.java:52259)
      at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:52198)
      at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
      at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql3_query(Cassandra.java:1797)
      at org.apache.cassandra.thrift.Cassandra$Client.prepare_cql3_query(Cassandra.java:1783)
      at org.apache.cassandra.stress.util.SimpleThriftClient.prepare_cql3_query(SimpleThriftClient.java:79)
      at org.apache.cassandra.stress.StressProfile.getInsert(StressProfile.java:378)
      ... 8 more

      Please take note of the CREATE Table statement in the YAML file

      CREATE TABLE request_trace (service_context_id text,trace_statement text, PRIMARY KEY (service_context_id, trace_statement))

      When adding an extra column, it works.

      Attachments

        1. request_trace_2.yaml
          0.9 kB
          Guillaume Labelle

        Activity

          People

            Unassigned Unassigned
            glabelle Guillaume Labelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: