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
2
votes
0 answers

SIGSEGV error while checking cassandra session is closed or not

This is the code to check gocql session is closed or not. I am using gocql.Session.Closed but getting sigsegv error on closed part when cassandra.service is down. The expected output should be to give status is down although the code is getting…
Mesc
  • 123
  • 7
2
votes
1 answer

How can I add query parameters dynamically using gocql?

What is the best way of writing a query based on filter inputs(vendor_id, customer_id, order_status_id ... or all nonempt field at the same time) in one function(Golang, Gocql, Cassandra)? I don't want to write new function in every case like the…
2
votes
1 answer

Constantly Reconnect to Cassandra

I have read online that the best practice when using Cassandra is to have 1 Cluster and 1 Session for the lifetime of your service. My questions are: In case our Cassandra server goes down, how do I make sure that my Cluster and/or Session will…
Floating Sunfish
  • 4,920
  • 5
  • 29
  • 48
2
votes
2 answers

Inserting an array of user defined types into Cassandra using gocql

I have a UDT in Cassandra and I have a table that has an array of these UDTs in its schema. Here's a sample: CREATE TYPE keyspace.test_type( x float, y float) In my schema I have CREATE TABLE test_table( key text, test_array…
h94
  • 155
  • 8
2
votes
1 answer

gocql Query.Get() vs Query.GetRelease()

What does Query.Release() do behind the scene? What does that mean 'return query back to pool'? When Query.Get() should be used and when Query.GetRelease()?
user1142902
  • 101
  • 1
  • 4
2
votes
2 answers

How can we mock cassandra session using golang?

Q : Is there any way to mock casssandra session using go without actually connecting to any keyspace/schema/DB. Can we mock cassandra for unit testing?
DKM
  • 31
  • 1
  • 2
2
votes
1 answer

gocql - using Cassandra 3 timeuuid functions

In cqlsh I can execute something like: SELECT id FROM names WHERE name = 'dave' AND id > maxTimeuuid('2015-04-05 00:05') AND id < minTimeuuid('2019-01-01 00:05'); ... this returns a list as expected. id -------------------------------------- …
thechane
  • 349
  • 1
  • 2
  • 12
2
votes
2 answers

How to create a keyspace in cassandra using gocql

Is there any way to create a new keyspace in cassandra with gocql ?
Ismail H
  • 4,226
  • 2
  • 38
  • 61
2
votes
1 answer

Getting "gocql: no response to connection startup within timeout" while connecting to Cassandra

Trying to connect to Cassandra (v 3.10.0) using gocql (Go: 1.8.3). Here is the error gocql: unable to dial control conn [hostIP]: gocql: no response to connection startup within timeout panic: gocql: unable to create session: control: unable to…
Abhishek
  • 1,175
  • 1
  • 11
  • 21
2
votes
1 answer

GoCQL : Marshal string into timestamp

I am developing a time series data model with clustering column i.e. CREATE TABLE events ( id text, time timestamp, type text, val double, PRIMARY KEY (id, time) ) WITH CLUSTERING ORDER BY (time DESC) I wish to perform a select…
mcfongtw
  • 217
  • 2
  • 13
2
votes
1 answer

Paging Large Queries: total number

Regarding Cassandra and paging. I might guess the answer but just to be sure; I know how to ask for a pagesize, but is it possible to get the eventually total number for a query. Like you query select * from tableName with a pagesize of 10, but if…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
2
votes
2 answers

App container to cassandra node - one to one or?

I am using containers to run both app servers & Cassandra nodes. When starting the app server container, I need to specify which Cassandra node(1..n) to connect to. How would you divide the workload? One app container to one or more Cassandra…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
2
votes
1 answer

Column added with "ALTER TABLE" doesn't appear when I make a request

I had a table containing those columns: cassandra@cqlsh:test> DESCRIBE Table "ItemSource"; CREATE TABLE connect."ItemSource" ( "Identifier" text, "SourceID" uuid, "ItemID" uuid, "Priority" int, "AdditionalParams" map
Julien Fouilhé
  • 2,583
  • 3
  • 30
  • 56
2
votes
2 answers

gocql SELECT * doesn't return all columns

I came across this weird behaviour while trying to implement some counters for my application. Basically, I did a counter table like so : CREATE TABLE stats_dev.log_counters ( date text PRIMARY KEY, all counter ); Then I have some specific…
Dalpapa
  • 177
  • 1
  • 12
1
vote
1 answer

How do I do a conditional upsert that preserves the value of a column?

I'm looking to mimic an upsert functionality but also add a conditional requirement that if the row doesn't already exist then insert all rows but if the row does exist, only update certain rows. I've spent a long time on this and can't seem to…
korum
  • 172
  • 1
  • 14