DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:

question avatar image asked Erick Ramirez answered

Getting "IllegalArgumentException: No query defined with name user_by_email" while running cassandra-stress in DS210


I am getting below error while running cassandra Stress Test. Please help.



ubuntu@ds210-node2:/var/log/cassandra$ cassandra-stress user profile=/home/ubuntu/labwork/TestProfile.yaml ops\(insert=4,user_by_email=4\) -node ds210-node1
******************** Stress Settings ********************
Type: user
Count: -1
No Warmup: false
Consistency Level: LOCAL_ONE
Target Uncertainty: 0.020
Minimum Uncertainty Measurements: 30
Maximum Uncertainty Measurements: 200
Command Ratios: {insert=4.0, user_by_email=4.0}
Command Clustering Distribution: clustering=gaussian(1..10)
Profile File(s): /home/ubuntu/labwork/TestProfile.yaml
Auto: true
Min Threads: 4
Max Threads: 1000
Distribution: Gaussian: min=1,max=1000000,mean=500000.500000,stdev=166666.500000
Wrap: false
Revisits: Uniform: min=1,max=1000000
Visits: Fixed: key=1
Row Population Ratio: Ratio: divisor=1.000000;delegate=Fixed: key=1
Batch Type: not batching
Ignore: false
Tries: 10
No Summary: false
No Settings: false
No Progress: false
Show Queries: false
Query Log File: null
File: null
Interval Millis: 1000
Connection Style: CQL_PREPARED
CQL Version: CQL3
Protocol Version: DSE_V2
Username: null
Password: null
Auth Provide Class: null
Max Pending Per Connection: 128
Connections Per Host: 8
Compression: NONE
Nodes: [ds210-node1]
Is White List: false
Datacenter: null
Keyspace: null
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Strategy Options: {replication_factor=1}
Table Compression: null
Table Compaction Strategy: null
Table Compaction Strategy Options: {}
truststore=null; truststore-type=null; truststore-password=null; keystore=null; keystore-type=null; keystore-password=null; ssl-protocol=TLS; ssl-alg=SunX509; ssl-ciphers=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA;
Native Port: 9042
JMX Port: 7199
Send To Daemon:
*not set*
File: null
Revision: unknown
Title: null
Operation: USER
Wrap: true
Split Factor: 1

******************** Profile(s) ********************
Keyspace Name: killr_video
Keyspace CQL:
CREATE KEYSPACE killr_video WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};

Table Name: user_by_email
Table CQL:
CREATE TABLE user_by_email (
email TEXT,
password TEXT,
user_id UUID,
PRIMARY KEY ((email))

Extra Schema Definitions: null
Generator Configs:
password: Size: Exponential: min=8,max=30,mean=14.234680;Identity: Uniform: min=1,max=1000000;
user_id: Size: Fixed: key=4;Identity: Uniform: min=1,max=1000000;
email: Size: Gaussian: min=8,max=30,mean=19.000000,stdev=3.666667;Identity: Exponential: min=1,max=1000000,mean=144764.693015;
Query Definitions:
get_user: CQL:select * from user_by_email where email = ?;Fields:null;
Token Range Queries:
Insert Settings:
partitions: fixed(1)
batchtype: UNLOGGED
select: fixed(1)/1
Connected to cluster: KillrVideoCluster, max pending requests per connection 128, max connections per host 8
Datacenter: dc1; Host: ds210-node1/; Rack: rack1
Created schema. Sleeping 1s for propagation.
Insert Statement:
UPDATE user_by_email SET password = ?,user_id = ? WHERE email = ?
Generating batches with [1..1] partitions and [1..100] rows (of [1..1] total rows in the partitions)

Sleeping 2s...
Warming up insert with 0 iterations...
Failed to connect over JMX; not collecting these stats

Warming up user_by_email with 0 iterations...
Failed to connect over JMX; not collecting these stats
java.lang.IllegalArgumentException: No query defined with name user_by_email
at org.apache.cassandra.stress.StressProfile.getQuery(
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(
at org.apache.cassandra.stress.settings.SettingsCommandUser$1.get(
at org.apache.cassandra.stress.operations.SampledOpDistributionFactory$1.get(
at org.apache.cassandra.stress.StressAction$Consumer.<init>(
at org.apache.cassandra.stress.StressAction.warmup(
at org.apache.cassandra.stress.Stress.main(

1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Please advice.....

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

As this error states, there is no query in your profile YAML called user_by_email:

java.lang.IllegalArgumentException: No query defined with name user_by_email

In step 11 of exercise 01.02 for DS210, you needed to create query called user_by_email:

    cql: select * from user_by_email where email = ?
    fields: samerow

But in the output you posted above, you created a query called get_user:

  Query Definitions:
    get_user: CQL:select * from user_by_email where email = ?;Fields:null;

You have 2 options:

  1. You can fix your profile YAML and re-run the stress test.
  2. Re-run the stress test with get_user=N:
$ cassandra-stress user \
    profile=/home/ubuntu/labwork/TestProfile.yaml \
    ops(insert=4,get_user=4) \
    -node ds210-node1


10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.