timescale / tsbs

Time Series Benchmark Suite, a tool for comparing and evaluating databases for time series data
MIT License
1.26k stars 299 forks source link

Cassandra run_queries issue: no keyspace has been specified #124

Closed seybi87 closed 4 years ago

seybi87 commented 4 years ago

Hi guys,

I am trying to run the TSBS against a Cassandra instance (version 3.11.2).

The load phase works well and the data is inserted into Cassandra. I am using the following command:

cat /opt/workloads/data/cassandra-data.gz | gunzip | /opt/workloads/tsbs/bin/tsbs_load_cassandra --db-name="benchmark" --workers=2 --reporting-period="10s" --batch-size=10 --hosts 192.168.0.214:9042 --replication-factor 1 --consistency ONE

An exemplary set of queries is generated with the following command:

/opt/workloads/tsbs/bin/tsbs_generate_queries --use-case="cpu-only" --seed=123 --scale=1000 --timestamp-start="2016-01-01T00:00:00Z" --timestamp-end="2016-01-01T02:00:01Z" --queries=1000 --query-type="single-groupby-1-1-1" --format="cassandra" | gzip > /opt/workloads/data/cassandra-queries.gz

Yet, when running these queries with:

cat /opt/workloads/data/cassandra-queries.gz | gunzip | /opt/workloads/tsbs/bin/tsbs_run_queries_cassandra --workers 2 --host 192.168.0.214:9042 --aggregation-plan server

I get the following error: No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename

I checked the Cassandra instance and the benchmark keyspace is created and the data is inserted.

Thanks for any help how to fix this issue!

seybi87 commented 4 years ago

I have debugged the issue and the default value for the keyspace, via the db-name parameter is never set because the following code snippet is missing the main.go. Yet, this code snippet is required to initialize the config struct.

if err := viper.Unmarshal(&config); err != nil {
        panic(fmt.Errorf("unable to decode config: %s", err))
}
RobAtticus commented 4 years ago

Merged, thank you!