hey Matt-
The docs are going to get a make over with v0.4.0. They're pretty rough right now.
To overlay values from two streams you'll need to use a non-transient property for "size". Let's say you have the following events:
{"timestamp":"2000-01-01T00:00:00Z", "data":{"size":10}}
{"timestamp":"2000-01-01T00:01:00Z", "data":{"color":"blue"}}
{"timestamp":"2000-01-01T00:02:00Z", "data":{"color":"red"}}
{"timestamp":"2000-01-01T00:04:00Z", "data":{"size":20}}
{"timestamp":"2000-01-01T00:05:00Z", "data":{"color":"red"}}
Assuming "size" is non-transient then you can run a query like this:
$ curl localhost:8585/tables/my_table/query -d '
WHEN color != "" THEN
SELECT count() GROUP BY size, color
END
'
And you'll get:
{
"size":{
"10":{
"color":{
"blue":{"count":1},
"red":{"count":1}
}
},
"20":{
"color":{
"red":{"count":1}
}
}
}
}
Since the "size" property is non-transient then it'll persist until changed and the value can be used in other events that occur after it is set -- even if those events come from an unrelated source. This also has an effect that if you delete the "size" change at "2000-01-01T00:04:00Z" then the second "red" will then get grouped under "size=10".
Does that make sense?