MF-1061 - Fix cassandra-reader count for json format (#1327)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
This commit is contained in:
parent
8e5a9cfc9a
commit
a8c652f96c
|
@ -50,13 +50,14 @@ func (cr cassandraRepository) ReadAll(chanID string, offset, limit uint64, query
|
||||||
value, string_value, bool_value, data_value, sum, time,
|
value, string_value, bool_value, data_value, sum, time,
|
||||||
update_time FROM messages WHERE channel = ? %s LIMIT ?
|
update_time FROM messages WHERE channel = ? %s LIMIT ?
|
||||||
ALLOW FILTERING`, q)
|
ALLOW FILTERING`, q)
|
||||||
|
countCQL := fmt.Sprintf(`SELECT COUNT(*) FROM %s WHERE channel = ? %s ALLOW FILTERING`, defTable, q)
|
||||||
|
|
||||||
if table != defTable {
|
if table != defTable {
|
||||||
selectCQL = fmt.Sprintf(`SELECT channel, subtopic, publisher, protocol, created, payload FROM %s WHERE channel = ? %s LIMIT ?
|
selectCQL = fmt.Sprintf(`SELECT channel, subtopic, publisher, protocol, created, payload FROM %s WHERE channel = ? %s LIMIT ?
|
||||||
ALLOW FILTERING`, table, q)
|
ALLOW FILTERING`, table, q)
|
||||||
|
countCQL = fmt.Sprintf(`SELECT COUNT(*) FROM %s WHERE channel = ? %s ALLOW FILTERING`, table, q)
|
||||||
}
|
}
|
||||||
|
|
||||||
countCQL := fmt.Sprintf(`SELECT COUNT(*) FROM %s WHERE channel = ? %s ALLOW FILTERING`, defTable, q)
|
|
||||||
|
|
||||||
iter := cr.session.Query(selectCQL, vals...).Iter()
|
iter := cr.session.Query(selectCQL, vals...).Iter()
|
||||||
defer iter.Close()
|
defer iter.Close()
|
||||||
scanner := iter.Scanner()
|
scanner := iter.Scanner()
|
||||||
|
|
Loading…
Reference in New Issue