AGGREGATE

Post Reply
Steffenadensis
Posts: 31
Joined: Tue Jul 29, 2014 11:42 am

AGGREGATE

Post by Steffenadensis » Tue Dec 16, 2014 11:44 am

Hello,

i just used the AGGREGATE Operator, with a simple client implemented in Ruby.

Code: Select all

#PARSER PQL
#RUNQUERY

accessp4000 = ACCESS({source='accessp4000',
wrapper='GenericPush',
transport='TcpServer',
protocol='line',
dataHandler='Tuple',
options=[['port', '4000']],
schema=[['line','String']]
})

out = AGGREGATE({
          aggregations=[['COUNT', 'line', 'COUNT_line', 'integer']]
        },
        accessp4000
      )

Code: Select all

require 'socket'

connection = TCPSocket.new("localhost", 4000)
x = "EBU_DE_ALD02_02_01_m/123/0.315/0/0/0/0/0/0/1/"

10.times do
	connection.puts x 
	sleep(1)
end

connection.close
I think the Operator do not work in every Situation.

1. The View which i open with, right click - show stream elements, just shows me after the first run 9 Aggregated Elements. In this example only 9 instead of 10, so one is missing, when i execute the Client again it shows me 19 elements, one is still missing in the Aggregation.

2. When i execute the ruby whitout the sleep ( #sleep(1) ), it only show me somethink like 5, 7, next ruby execution -> 10, 11, 13, 18, next-> 20, 25, 26.... and not like expacted 1,2,3,4,5,6... per row.
Kind regards

T. Steffen

Operating system: Debian GNU/Linux 7.6 (wheezy)

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: AGGREGATE

Post by Marco Grawunder » Tue Dec 16, 2014 2:58 pm

Ok.

The first question:
- The aggregate operator needs to keep the last element until it knows that non is comming anymore should should be aggregated.
- If you use the option: DRAINATCLOSE = true, elements will be written, when the is stopped. Here seems to be an error in the documentation, the default value here is false.

The seconds question:
The aggregation aggregates elements with overlapping timestamps. You are using system time and in this case the minimal value is milliseconds. When the data is to fast, the tuple get the same starttimestamp and are aggregated together at once. If you want different values, you could simply add a counter to you ruby progamm and add STARTTIMESTAMP to this counter.

http://wiki.odysseus.offis.uni-oldenbur ... and+Window

Steffenadensis
Posts: 31
Joined: Tue Jul 29, 2014 11:42 am

Re: AGGREGATE

Post by Steffenadensis » Wed Dec 17, 2014 4:43 pm

o.k thanks, good to know :)
Kind regards

T. Steffen

Operating system: Debian GNU/Linux 7.6 (wheezy)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest