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
1
vote
1 answer

gocqlx Updatebuilder and get wrong result

first, my table design are follow: create table io ( qa text primary key, created_at text, messages list>, reply boolean, resolve boolean, updated_at text, user text, uuid …
Volz
  • 21
  • 3
1
vote
2 answers

How log Cassandra queries on application side?

I'm using gocql driver in my application. Is there a way for the driver to log queries on the console? How do I configure the logger to print complete queries (along with data bindings) package main import ( "fmt" …
1
vote
1 answer

Figuring out Page State with Cassandra GOCQL Driver (Golang)

I've been trying to wrap my head around how paging in Apache Cassandra with the driver functions in GOlang. I have the following code for fetching rows /// Assume all other prerequisites. session, _ :=…
GhostRavenstorm
  • 634
  • 3
  • 9
  • 29
1
vote
1 answer

gocql + docker "not found"

I have a docker compose file set up like this: version: "3" services: web: image: myApp container_name: web environment: CASSANDRA_HOSTS: "db" ports: - "8080:8080" restart: unless-stopped depends_on: -…
billdoor
  • 1,999
  • 4
  • 28
  • 54
1
vote
0 answers

Multiple-Partition Batch in Cassandra with Golang and Gocqlx

I'm trying to perform a multiple-partition BATCH in Cassandra using Golang and Gocqlx. My problem is that I can't get my BATCH statements to work properly. My goal is as follows: 1. Perform an INSERT to second_table. 2. Perform an UPDATE to…
Floating Sunfish
  • 4,920
  • 5
  • 29
  • 48
1
vote
1 answer

Cassandra query 2nd index with pagination become slower when data grow

When I query secondary index with pagination, query becomes slower when data grows. I thought with pagination, no matter how large your data grow, it takes same time to query one page. Is that true? Why my query get slower? My simplified table is…
vancexu
  • 1,548
  • 3
  • 19
  • 30
1
vote
1 answer

gocql can not unmarshal blob into *[20]uint8

I have a question related to using blob type as partition key. I use it, as I need to save hash value. (hash value returns binary data. usually as hexadecimal.) I tried a select query with gocql, however it failed with following error. Is there any…
simotunes
  • 167
  • 2
  • 15
1
vote
1 answer

gocql blocks on too many concurrent read requests (golang, Cassandra)

Using GOCQL (Golang, Cassandra), I make up to 128 requests, and then everything hangs. I believe in the getTicksForCassandraKey() function I am properly releasing the Query, but not sure. GOCQL only supports up to 128 concurrent queries, so I must…
user1387717
  • 1,039
  • 1
  • 13
  • 30
1
vote
1 answer

Make a blocking/consistent/predictable reply/request on ScyllaDB via GoCQL

Sometimes when running a command it shows a timeout (gocql: no response received from cassandra within timeout period), for example: package main import "fmt" import "github.com/gocql/gocql" import "time" import "log" func main() { clust :=…
Kokizzu
  • 24,974
  • 37
  • 137
  • 233
1
vote
0 answers

gocql/gocql fails create new session: invalid memory address or nil pointer dereference

I'm working on a api written with Go, that has a main goal that it should answer the request as fast as possible. I came up with using goroutines. I test it with wrk with this command: $ wrk -t1 -c200 -d1s http://127.0.0.1:8080 // this…
mdaliyan
  • 93
  • 1
  • 1
  • 6
1
vote
1 answer

Gocql custom marshaller

I have a table with a tuple column that is made up of an int64 paired with a uuid: CREATE TABLE ks.mytable { fileid frozen >, hits counter, ... and I can currently set the field using a cql statement…
Charles L.
  • 5,795
  • 10
  • 40
  • 60
1
vote
1 answer

cassandra lastupdated(auto_now), lastaccessed and created(auto_now_add)

Is there a way we can auto update the columns creation and last updated/accessed timestamp? We can use toTimestamp(now()) function to store the creation time. But do we have a function like writetime(name), which is used to get the last modified…
1
vote
1 answer

Passing a map as a value to insert into Cassandra

I'm trying to insert a map value into my Cassandra database. I'm using Go to write my client. Currently its throwing the error "can not marshal string into map(varchar, varchar)". I understand what the error is, but I can't resolve it. Here is the…
Joshua de Leon
  • 59
  • 1
  • 4
  • 19
1
vote
1 answer

Scan not working

My scan is not updating its destination variable. I sort of got it working with: ValueName := reflect.New(reflect.ValueOf(value).Elem().Type()) But I don't think it is working the way I want. func (self LightweightQuery) Execute(incrementedValue…
Jared Mackey
  • 3,998
  • 4
  • 31
  • 50
1
vote
1 answer

golang gocql failed to connect to 127.0.0.1:9042 not enough bytes to read header require 9 got: 8

I get this error trying to compile: package main import "fmt" import "log" import "github.com/gocql/gocql" var ( name, sex string age int ) func main() { // connect to the cluster cluster := gocql.NewCluster("127.0.0.1") …
batflaps
  • 261
  • 3
  • 12