The particular problem I’m having is that when count() is chained after where(), which is filtering a window()…
stream
| window().every(1s).period(60s)
| where(...)
| count('timestamp')
If the stream starts with data that does not fit the where criteria, count seems to initialize to an InfluxQL node for type float64. If the stream starts with data that does fit the where criteria, counts seems to initialize to an InfluxQL node for type int64.
The problem is if the count node starts as a float64 type, then when data meeting the where criteria start arriving, the timestamp type is int64, therefore kapacitor throws the following error
2017/03/23 17:14:13 E! failed to aggregate batch: field timestamp has wrong type: got int64 exp float64
I believe there is no way to coerce the data type for an InfluxQL node, and coercing timestamp to float64 would be the wrong thing to do.
Is my assessment above accurate? Am I misunderstanding some nuance of what’s going on?