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 types of message I want to count as well, so in my Go app, I ALTER the table to add the column I didn't have before.
My app is growing, and I start to have more than 30 columns (shouldn't be more than 50) and when I want to retrieve all those counters, some columns are missing in the result.
query := s.Query(`SELECT * FROM `+_apiCountersTable+` WHERE date IN ?`, dates)
res, err := query.Iter().SliceMap()
This returns me something like 30 over 34 columns. Although, when I do the request on CQLSH :
cqlsh:stats_dev> SELECT * FROM api_counters WHERE date = 'total';
I get the proper full result. So :
- Does that come from my request which should be different ?
- Could that come from gocql driver ?
- Is that pattern completely stupid ?
My temporary solution is to SELECT the column names from the system.schema_columns
table and to strings.Join() all of that to my SELECT query ...
Thank you very much for your help.