use of org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangJoinStreamingInput joinStreamingInput) {
StreamingInput streamingInput = joinStreamingInput.getStreamingInput();
if (streamingInput != null) {
((BLangStreamingInput) streamingInput).accept(this);
}
ExpressionNode expressionNode = joinStreamingInput.getOnExpression();
if (expressionNode != null) {
((BLangExpression) expressionNode).accept(this);
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput in project ballerina by ballerina-lang.
the class TypeChecker method visit.
@Override
public void visit(BLangJoinStreamingInput joinStreamingInput) {
BLangStreamingInput streamingInput = (BLangStreamingInput) joinStreamingInput.getStreamingInput();
streamingInput.accept(this);
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method visit.
@Override
public void visit(BLangJoinStreamingInput joinStreamingInput) {
BLangBinaryExpr expr = (BLangBinaryExpr) joinStreamingInput.getOnExpression();
BLangStreamingInput streamingInput = (BLangStreamingInput) joinStreamingInput.getStreamingInput();
joinStreamingInputClause = new StringBuilder();
streamingInput.accept(this);
if (joinStreamingInput.isUnidirectionalBeforeJoin()) {
joinStreamingInputClause.append(" unidirectional ");
}
String joinType = joinStreamingInput.getJoinType();
joinStreamingInputClause.append(" ").append(joinType).append(" ");
if (joinStreamingInput.isUnidirectionalAfterJoin()) {
joinStreamingInputClause.append(" unidirectional ");
}
joinStreamingInputClause.append(streamingInputClause).append(" on ");
binaryExpr = new StringBuilder();
expr.accept(this);
joinStreamingInputClause.append(binaryExpr);
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method visit.
@Override
public void visit(BLangStreamingQueryStatement streamingQueryStatement) {
siddhiQuery.append("from ");
StreamingInput streamingInput = streamingQueryStatement.getStreamingInput();
if (streamingInput != null) {
((BLangStreamingInput) streamingInput).accept(this);
siddhiQuery.append(" ").append(streamingInputClause);
}
PatternClause patternClause = streamingQueryStatement.getPatternClause();
if (patternClause != null) {
patternStreamingClause = new StringBuilder();
((BLangPatternClause) patternClause).accept(this);
siddhiQuery.append(" ").append(patternStreamingClause);
}
JoinStreamingInput joinStreamingInput = streamingQueryStatement.getJoiningInput();
if (joinStreamingInput != null) {
((BLangJoinStreamingInput) joinStreamingInput).accept(this);
siddhiQuery.append(" ").append(joinStreamingInputClause);
}
SelectClauseNode selectClauseNode = streamingQueryStatement.getSelectClause();
if (selectClauseNode != null) {
((BLangSelectClause) selectClauseNode).accept(this);
siddhiQuery.append(" ").append(selectExprClause);
}
OrderByNode orderByNode = streamingQueryStatement.getOrderbyClause();
if (orderByNode != null) {
((BLangOrderBy) orderByNode).accept(this);
siddhiQuery.append(" ").append(orderByClause);
}
OutputRateLimitNode outputRateLimitNode = streamingQueryStatement.getOutputRateLimitNode();
if (outputRateLimitNode != null) {
((BLangOutputRateLimit) outputRateLimitNode).accept(this);
siddhiQuery.append(" ").append(outputRateLimitClause);
}
BLangStreamAction streamActionNode = (BLangStreamAction) streamingQueryStatement.getStreamingAction();
if (streamActionNode != null) {
streamActionNode.accept(this);
siddhiQuery.append(" ").append(streamActionClause);
siddhiQuery.append(" ; ");
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput in project ballerina by ballerina-lang.
the class SqlQueryBuilder method visit.
@Override
public void visit(BLangTableQuery tableQuery) {
BLangSelectClause selectClause = (BLangSelectClause) tableQuery.getSelectClauseNode();
BLangStreamingInput streamingInput = (BLangStreamingInput) tableQuery.getStreamingInput();
BLangJoinStreamingInput joinStreamingInput = (BLangJoinStreamingInput) tableQuery.getJoinStreamingInput();
BLangOrderBy orderBy = (BLangOrderBy) tableQuery.getOrderByNode();
StringBuilder sqlTableQuery = new StringBuilder();
/*Add each clause to the sqlQuery and add the params to TableQuery object*/
addSelectClauseAndParams(tableQuery, selectClause, sqlTableQuery);
addFromClauseAndParams(tableQuery, streamingInput, sqlTableQuery);
addJoinClauseAndParams(tableQuery, joinStreamingInput, sqlTableQuery);
addGroupByClause(selectClause, sqlTableQuery);
addHavingClauseAndParams(tableQuery, selectClause, sqlTableQuery);
addOrderByClause(orderBy, sqlTableQuery);
tableQuery.setSqlQuery(sqlTableQuery.toString());
}
Aggregations