awslabs/kinesis-aggregation

Iterative Aggregation documentation is incorrect

bisoldi opened this issue · 0 comments

The Iterative Agg documentation reads as follows:

Iterative Aggregation

The iterative aggregation method involves adding records one at a time to the RecordAggregator and checking the response to determine when a full aggregated record is available. The add_user_record method returns None when there is room for more records in the existing aggregated record and returns an AggRecord object when a full aggregated record is available for transmission.

for rec in records:
    result = kinesis_aggregator.add_user_record(rec.PartitionKey, rec.Data, rec.ExplicitHashKey)
    if result:
        #Send the result to Kinesis

In reality, the iterative aggregation method add_user_record returns True or False and then we need to call get_contents to get the record.