Questions tagged [gocql]

GOCQL is the golang driver for connecting to Cassandra.

GOCQL is the Google go language's driver for connecting to Apache Cassandra.

91 questions
24
votes
5 answers

How to set GOPATH in Mac OS X 10.10

I installed Go 1.4 in Mac OS X. Previously I had Go 1.0. I set the GOROOT and PATH as follows, Dineshs-MacBook-Air:go-cassandra Dany$ which go /usr/local/go/bin/go Dineshs-MacBook-Air:go-cassandra Dany$ export…
Dany
  • 2,692
  • 7
  • 44
  • 67
6
votes
2 answers

Golang with Cassandra db using docker-compose : cannot connect (gocql)

I am trying to setup a cassandra DB and connect to it with a golang app. this is my docker-compose version: "3.6" services: cassandra: image: cassandra:4.0 ports: - 9042:9042 volumes: -…
F4Ke
  • 1,631
  • 1
  • 20
  • 49
4
votes
1 answer

Artificially create Cassandra error to test retry policy

How might you force a Cassandra error that triggers a retry policy? According to the DataStax, the following errors trigger a retry policy: Read and write timeouts. When the coordinator determines there are not enough replicas to satisfy a…
Tantillo
  • 367
  • 1
  • 5
4
votes
1 answer

gocql.createSession: Consistency level ANY is not supported for this operation

Getting following error while trying to create session from cql, Error: Consistency level ANY is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE I've used Amazon Managed Apache Cassandra…
Pinank Lakhani
  • 1,109
  • 2
  • 11
  • 31
3
votes
1 answer

Why Cassandra does not give error on inserting duplicate record?

CQL version 5.0.1 Cassandra version 3.11.9 root@3fdb49de030c:/# cqlsh Connected to Test Cluster at 127.0.0.1:1234. [cqlsh 5.0.1 | Cassandra 3.11.9 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. cqlsh> On inserting same record(as shown…
overexchange
  • 15,768
  • 30
  • 152
  • 347
3
votes
1 answer

How to optimize cross shard queries for scylla db using gocql

I'm using a scylla cluster with 9 nodes and replication factor to be 3. One application opens one connections to it, reading and writing data. However, I notice in the scylla CQL optimization monitoring dashboard, the percentage for cross shard is…
SilentCanon
  • 626
  • 4
  • 11
3
votes
0 answers

How to check if CQL query is applied

I have an API Server written on golang in a front of Cassandra, so I use gocql as driver. What I want is to return an error if someone tries to create duplicated entries in Cassandra, so I need not only idempotent operation (which could be achieved…
3
votes
1 answer

Unable to create session connecting to Cassandra

I am using this gocql package. I am trying to get this example working. func main() { // connect to the cluster cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3") cluster.ProtoVersion = 3 cluster.Keyspace =…
SomeGuyFortune
  • 1,024
  • 13
  • 26
3
votes
1 answer

Getting timeout error with Gocql

I am getting following errors while inserting data in Cassandra. I am using gocql client for Cassandra. {"error":"gocql: too many query timeouts on the connection","status":500} {"error":"gocql: no response received from cassandra within timeout…
chetan dev
  • 611
  • 2
  • 6
  • 16
3
votes
1 answer

Golang cassandra client with connection pool support

We are using gocql (https://github.com/gocql/gocql) driver to connect to Cassandra from our golang server. For every http request, we are creating a new session and inserting rows into cassandra. We feel it is very much resource intensive to create…
kannanrbk
  • 6,964
  • 13
  • 53
  • 94
3
votes
3 answers

How to get the number of rows returned by a query using gocql

I am using the gocql library which is documented here: https://godoc.org/github.com/relops/cqlc/cqlc#Fetchable and am trying to write an API call in golang that will ask for all of the elements in my database that fulfill a particular field and…
user6407048
  • 181
  • 1
  • 3
  • 11
2
votes
1 answer

Apache Cassandra with go server on low resources

I have a website that accepts files with a maximum size of 10 MB from users. It sends information about them in two messages by websocket - in the first the name and time of sending, in the second - the ArrayBuffer of the file. This all works well…
Zlat
  • 21
  • 2
2
votes
1 answer

How do I set the maximum pool size in gocql?

I wanted to know how can we explicitly set max pool size in gocql? I mean changing the number of queries which will be run simultaneously. We are having 200ms avg response time in Grafana, but we are seeing 24ms avg read latency in Cassansra…
Mojtaba Arezoomand
  • 2,140
  • 8
  • 23
2
votes
1 answer

How do I count the number of records in a Cassandra table using the GoCQL driver?

I wanted write a simple program in golang (prefer GoCql) to count the number of records in a Cassandra table. so I can reduce the amount of load on db at a time and reduce the probability of timeouts. I just wanted to count the number of elements…
Ravi
  • 31
  • 4
2
votes
1 answer

Using IN() operator on CQL bigint column with GoCQL returns "can not marshal []int64 into bigint"

I have two columns in cassandra of type bigint. Using gocql I want to retrieve values from these columns using the IN clause. My query looks something like this - QUERY := select column1,column2,column3 from tableName where id1 in (?) and id2 in…
1
2 3 4 5 6 7