We have implemented cassandra using the aws keyspace service, and using the cassandra-driver for node. The client works fine and we are able to perform create and update operations on the data. However, running a simple cql query using the client returns no data (empty rows).
When I run the exact same query on cql editor on aws dashboard, it works fine and does return the required data.
Query:
SELECT * FROM <TABLE_NAME> WHERE product_id = '<PRODUCT_ID>' ALLOW FILTERING
Running the same query on the cql editor on aws dashboard works fine.
I noted that you're using the
ALLOW FILTERINGclause in your query which suggests thatproduct_idis not the table's partition key.If you're querying the table without the partition key, the coordinator of the request has to contact all nodes in the cluster to get requested data. There's a good chance that the query is timing out waiting for responses from all nodes so no data is returned.
I suspect it works in cqlsh because it has a higher timeout than the default for the Node.js driver.
You will need to review the application logs and look for warnings or errors from the Node.js driver for clues. Cheers!
Please support the Apache Cassandra community by hovering over the
cassandratag above and click on Watch tag. Thanks!