You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Status

Current state: Under Discussion

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here [Change the link from KAFKA-1 to your own ticket]

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

The Stream Table join is not able to handle late data in its current state. This semantic gap leads to incorrect output in some cases as the stream can only process data as it comes in. Also with versioned tables tables can now have history and being able to process the stream in order within the configured grace period will allow even more correct time semantics.

Public Interfaces

Joined.java
public class Joined {
	/**
	* Set the grace period on the stream side of the join. Records will enter a buffer before being processed. Late records in the grace period will be processed in timestamp order, records out of the grace period will be dropped.
	*
	* @param gracePeriod the duration of the grace period. If zero, no buffer will be used. 
	* @return new {@code Joined} instance configured with the gracePeriod
	*/
	public Joined withGracePeriod(Duration gracePeriod);
}


Proposed Changes

The grace period will be set on the Joined object. This is only used for the stream table join and will be optional to set.

If a grace period is not set the join will execute as before. If a grace period of zero is set the join will drop all late records from the stream side operations. If the grace period is non zero, the record will enter a stream buffer and will dequeue when the record timestamp is greater than stream time plus the grace period.

The buffer will be checked whenever stream time is advanced. 

Compatibility, Deprecation, and Migration Plan

Old Joins will not be affected, in order to use the new feature users will need to set a grace period. Nothing needs to be deprecated.

Test Plan

The testing should be covered with unit test and integration test. The only other tests that would be necessary, would be benchmarking to assess the  performance impact on the stream buffer on the join.

Rejected Alternatives

  • Only allowing grace period for versioned tables. This would be unnecessarily restrictive especially if the table is not going to change and there is no need for the versioning. Or if the table is already materialized for another use that does not want versioning
  • No labels