|
|
|
|
|
![]() |
|
![]() |
(To used the "standard" projection operation, just use the identity map)
(To remove attributes, just omit the attribute from the map operation).
|
![]() |
|
|
Example:
|
|
A order specification works like a filter:
|
Time: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| --+---+---+---+---+---+---+---+---+---+---+--------- sample --+---+---+---+---+---+---+---+---+---+---+--------- input stream: | 1 | 3 | 1 | 2 | 4 | 4 | 8 | 3 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+--------- Buffer content: --+---+---+---+---+---+---+---+---+---+---+-------- | 1 | 1 | 1 | 1 | 2 | 3 | 4 | 4 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- | - | 3 | 1 | 2 | 3 | 4 | 4 | 4 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- | - | - | 3 | 3 | 4 | 4 | 8 | 8 | 8 | 8 --+---+---+---+---+---+---+---+---+---+---+-------- | V 3 violates order specification Discarded ?? (page 131, line 6) Output stream: (= first item in buffer) --+---+---+---+---+---+---+---+---+---+---+-------- | - | - | 1 | 1 | 2 | 3 | 4 | 3 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- |
NOTE: GroupBy NULL means use no grouping attributes
It will put all tuples in the same group
|
O = Order( On A , Slack 2 , GroupBy NULL ); BSort( O ) (S) |
Input stream: 1, 3, 1, 2, 4, 4, 8, 3, 4, 4
Output:
Time: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| --+---+---+---+---+---+---+---+---+---+---+--------- sample --+---+---+---+---+---+---+---+---+---+---+--------- input stream: | 1 | 3 | 1 | 2 | 4 | 4 | 8 | 3 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+--------- Buffer content: --+---+---+---+---+---+---+---+---+---+---+-------- | 1 | 1 | 1 | 1 | 2 | 3 | 4 | 4 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- | - | 3 | 1 | 2 | 3 | 4 | 4 | 4 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- | - | - | 3 | 3 | 4 | 4 | 8 | 8 | 8 | 8 | --+---+---+---+---+---+---+---+---+---+---+-------- | V 3 violates order specification It's not discarded ???????? (Contradicts page 131, line 6) Output stream: (= first item in buffer) --+---+---+---+---+---+---+---+---+---+---+-------- | - | - | 1 | 1 | 2 | 3 | 4 | 3 | 4 | 4 | --+---+---+---+---+---+---+---+---+---+---+-------- |
I think there is an error - according to the definition of Order, the system should discard the value 3 that is 3 places out of order...
Then again, it could be that the BSort operator never discard tuples but output out of order tuples as soon as possible..
I did not write the paper; so I can't tell you if this is a real error. Here is the actual example in the paper:
![]() |
|
|
|
SQuAl aggregate function:
|
Sample input data:
![]() |
The Join operation is apply on windows of tuples
(Ideally you would wait for a streams to drain completely before performing the join operation... but that is not possible with stream queries).
|
|
Join predicate: S1.Position = S2.Position
Sample input data:
![]()
|
In addition to the predicate S1.Position = S2.Position, the tuple must also satisfy:
A set function (window function) is applied on the matching set of tuples to produce a single tuple
|
For each tuple in S1, the aggregate (set) function F is applied on the tuples in stream S2 that satisfy:
|
Query:
|
E.g.: 2:00, 2:15, 2:30, etc....
|
![]() ![]() |
|
The data represents the position of a soldier ID at a given time Time
|
|
Concrete data:
![]() |
![]() |
![]() |
![]() |
That can be a helpful tool in debugging