pipelinedb aggregates in where clause -
im using pipelinedb testing analysis of data streams sensors. want able, example, find events in stream defined aggregate. e.g. find events difference between max(temperature) , min(temparature) in last 5 minutes exceeds range.
when trying put aggregates in clause error message saying 'aggregates not allowed in continuous views clasues'
am missing here or not possible?
otherwise pipelinedb very much!
well, pipelinedb says: "continuous queries don't support having clauses".
what i'm trying following:
i have stream named geo_vital_stream, sends sensor data along geolocation. @ moment interested
insert geo_vital_stream (device_id, user_id, measured_at, heartrate, energy, eda, lon, lat) values( 'a005d8-e4 2.0',1,'2015-10-08 15:04:33.134000+02',96.8497201823,351.056269367,0.505791,8.07154018407,52.9531484103 );
my cv looks this:
create continuous view cv_sensor_eda select user_id::integer, max(eda::numeric) - min(eda::numeric) range_eda geo_vital_stream (measured_at > clock_timestamp() - interval '1 minutes') group user_id
now, interested in "events", range (range_eda execeeds value in last minute.)
using aggregate in where
clause isn't legal sql. accomplished using having
clause, doesn't seem that's need here. since aggregates compute values across multiple rows, it's not clear me how you'd retrieve individual events based on aggregates (min
, max
) across multiple events. provide example of each event looks like?
Comments
Post a Comment