gocql and decimal values

32 Views Asked by At

I'm strugling with gocql and decimal values in cassandra... I have following table:

CREATE TABLE example.example (
    timestamp timestamp,
    value_dec decimal,
PRIMARY KEY....

Based on gocql docu decimal is mapped as inf.Dec, but I always got following error:

"can not unmarshal decimal into inf.Dec"

Can anybody help?

var timestamp time.Time
var value_dec inf.Dec


res:=  session.Query(`SELECT timestamp, value_dec FROM example.example LIMIT 3 ALLOW FILTERING`).WithContext(ctx).Iter().Scanner()

    for res.Next() {
            err = res.Scan(&timestamp, &value_dec)
            if err != nil {
                    log.Fatal(err)
            }
      
    }
0

There are 0 best solutions below