Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot set consistency level when querying Amazon Keyspaces service from DataGrip

I'm trying to perform inserts on Amazon's Managed Cassandra service from IntelliJ's DataGrip IDE, however I recieve the following error:

Consistency level LOCAL_ONE is not supported for this operation. Supported consistency levels are: LOCAL_QUORUM

This is due to Amazon using the LOCAL_QUORUM consistency level for writes.

I tried to set the consistency level with CONSISTENCY LOCAL_QUORUM; before running other queries but it returned the following error:

line 1:0 no viable alternative at input 'CONSISTENCY' ([CONSISTENCY])

From my understanding, this is because CONSISTENCY is a cqlsh command and not a CQL command.

I cannot find any way to set the consistency level from within DataGrip so that I can run scripts and populate my tables.

Ultimately, I will use plain cqlsh if I cannot find a solution but I was hoping to use DataGrip as I find it useful and have many databases already configured. I hope someone can shed some light on the issue, this seems like it should be a basic feature.

like image 622
Jack Avatar asked Dec 18 '25 19:12

Jack


2 Answers

I am Max from DataGrip team, and the correct answer is:

It could be JDBC driver issue and the desired method hasn't been implemented yet. Since you're trying to run pure cqlsh command as SQL. Follow the issue DBE-10638.

like image 73
moscas Avatar answered Dec 20 '25 10:12

moscas


It's a DataGrip bug, see https://youtrack.jetbrains.com/issue/DBE-10182 :

Cassandra 'CONSISTENCY' command is not supported

So upvote that bug, and maybe add a comment that it makes DataGrip useless for writing to Amazon Managed Cassandra

like image 30
Serban Teodorescu Avatar answered Dec 20 '25 09:12

Serban Teodorescu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!