Skip to content

Commit

Permalink
Merge pull request #4 from grainier/join-desugar
Browse files Browse the repository at this point in the history
 Change output processor to only return CURRENT events
  • Loading branch information
gimantha authored Sep 19, 2018
2 parents 0a531f4 + de8c7ed commit 2796453
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions stdlib/streams/src/main/ballerina/streams/output-processor.bal
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ public type OutputProcess object {
public function process(StreamEvent[] streamEvents) {
int index = 0;
foreach event in streamEvents {
map outputData;
foreach k, v in event.data {
string[] s = k.split("\\.");
if (OUTPUT.equalsIgnoreCase(s[0])) {
outputData[s[1]] = v;
if (event.eventType == "CURRENT") {
map outputData;
foreach k, v in event.data {
string[] s = k.split("\\.");
if (OUTPUT.equalsIgnoreCase(s[0])) {
outputData[s[1]] = v;
}
}
outputFunc(outputData);
}
outputFunc(outputData);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public void setup() {

@Test(description = "Test stream join query.")
public void testStreamJoinQuery() {
System.setProperty("enable.siddhiRuntime", "true");
BValue[] stocksWithPrices = BRunUtil.invoke(result, "startJoinQuery");
Assert.assertNotNull(stocksWithPrices);
Assert.assertEquals(stocksWithPrices.length, 2, "Expected events are not received");
Expand Down

0 comments on commit 2796453

Please sign in to comment.