Fix the JoinInputStreamParser compile condition builder on table join
@@ -218,17 +218,25 @@ public class JoinInputStreamParser {
if (compareCondition == null) {
compareCondition = Expression.value(true);
}
-
+ CompiledCondition leftCompiledCondition;
+ CompiledCondition rightCompiledCondition = null;
+ if (rightFindableProcessor instanceof TableWindowProcessor) {
+ MatchingMetaInfoHolder rightMatchingMetaInfoHolder = MatcherParser.constructMatchingMetaStateHolder
+ (metaStateEvent, 0, rightMetaStreamEvent.getLastInputDefinition(), UNKNOWN_STATE);
+ leftCompiledCondition = rightFindableProcessor.compileCondition(compareCondition,
+ rightMatchingMetaInfoHolder, siddhiAppContext, executors, tableMap, queryName);
+ } else {
MatchingMetaInfoHolder rightMatchingMetaInfoHolder = MatcherParser.constructMatchingMetaStateHolder
(metaStateEvent, 0, rightMetaStreamEvent.getLastInputDefinition(), UNKNOWN_STATE);
- CompiledCondition leftCompiledCondition = rightFindableProcessor.compileCondition(compareCondition,
+ leftCompiledCondition = rightFindableProcessor.compileCondition(compareCondition,
rightMatchingMetaInfoHolder, siddhiAppContext, executors, tableMap, queryName);
MatchingMetaInfoHolder leftMatchingMetaInfoHolder = MatcherParser.constructMatchingMetaStateHolder
(metaStateEvent, 1, leftMetaStreamEvent.getLastInputDefinition(), UNKNOWN_STATE);
- CompiledCondition rightCompiledCondition = leftFindableProcessor.compileCondition(compareCondition,
+ rightCompiledCondition = leftFindableProcessor.compileCondition(compareCondition,
leftMatchingMetaInfoHolder, siddhiAppContext, executors, tableMap, queryName);
+ }
- if (joinInputStream.getTrigger() != JoinInputStream.EventTrigger.LEFT) {
+ if (joinInputStream.getTrigger() != JoinInputStream.EventTrigger.LEFT && rightCompiledCondition != null) {
populateJoinProcessors(rightMetaStreamEvent, rightInputStreamId, rightPreJoinProcessor,
rightPostJoinProcessor, rightCompiledCondition);
}
