You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This seems to be corroborated by https://github.com/influxdata/kapacitor/blob/master/influxql.go#L180 which seems to be setting the type of reducer used by batch InfluxQL nodes to float64 by default when there are no points in the batch. Changing this line to int64(0) allows the above scenario to work without issue.
It seems like there should be a user settable property that specifies the default type rather than having a hard coded float64 default.
The text was updated successfully, but these errors were encountered:
@sputnik13 Thanks for the detailed report. That should not be happening, the type should be able to switch dynamically and so the default type choice of float should not matter. Clearly there is a bug, thanks again.
The particular problem I'm having is that when count() is chained after where(), which is filtering a window()...
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
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.
This seems to be corroborated by https://github.com/influxdata/kapacitor/blob/master/influxql.go#L180 which seems to be setting the type of reducer used by batch InfluxQL nodes to float64 by default when there are no points in the batch. Changing this line to int64(0) allows the above scenario to work without issue.
It seems like there should be a user settable property that specifies the default type rather than having a hard coded float64 default.
The text was updated successfully, but these errors were encountered: