use of org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause in project ballerina by ballerina-lang.
the class SqlQueryBuilder method createSQLSelectExpressionClause.
private void createSQLSelectExpressionClause(BLangSelectClause select) {
List<? extends SelectExpressionNode> selectExprList = select.getSelectExpressions();
selectExprClause = new StringBuilder();
selectExprClause.append("select ");
if (selectExprList != null && !selectExprList.isEmpty()) {
Iterator<? extends SelectExpressionNode> iterator = selectExprList.iterator();
BLangSelectExpression selectExpression = (BLangSelectExpression) iterator.next();
selectExpression.accept(this);
selectExprClause.append(selectExpr);
while (iterator.hasNext()) {
selectExpression = (BLangSelectExpression) iterator.next();
selectExprClause.append(", ");
selectExpression.accept(this);
selectExprClause.append(selectExpr);
}
} else if (select.isSelectAll()) {
selectExprClause.append("* ");
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause in project ballerina by ballerina-lang.
the class SqlQueryBuilder method createSQLGroupByClause.
private void createSQLGroupByClause(BLangSelectClause select) {
BLangGroupBy groupBy = (BLangGroupBy) select.getGroupBy();
groupBy.accept(this);
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangStreamingQueryStatement streamingQueryStatement) {
StreamingInput streamingInput = streamingQueryStatement.getStreamingInput();
if (streamingInput != null) {
((BLangStreamingInput) streamingInput).accept(this);
JoinStreamingInput joinStreamingInput = streamingQueryStatement.getJoiningInput();
if (joinStreamingInput != null) {
((BLangJoinStreamingInput) joinStreamingInput).accept(this);
}
}
SelectClauseNode selectClauseNode = streamingQueryStatement.getSelectClause();
if (selectClauseNode != null) {
((BLangSelectClause) selectClauseNode).accept(this);
}
OrderByNode orderByNode = streamingQueryStatement.getOrderbyClause();
if (orderByNode != null) {
((BLangOrderBy) orderByNode).accept(this);
}
StreamActionNode streamActionNode = streamingQueryStatement.getStreamingAction();
if (streamActionNode != null) {
((BLangStreamAction) streamActionNode).accept(this);
}
BLangPatternClause patternClause = (BLangPatternClause) streamingQueryStatement.getPatternClause();
if (patternClause != null) {
patternClause.accept(this);
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause in project ballerina by ballerina-lang.
the class TypeChecker method visit.
@Override
public void visit(BLangSelectClause selectClause) {
List<? extends SelectExpressionNode> selectExprList = selectClause.getSelectExpressions();
selectExprList.forEach(selectExpr -> ((BLangSelectExpression) selectExpr).accept(this));
BLangGroupBy groupBy = (BLangGroupBy) selectClause.getGroupBy();
if (groupBy != null) {
groupBy.accept(this);
}
BLangHaving having = (BLangHaving) selectClause.getHaving();
if (having != null) {
having.accept(this);
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method createSiddhiGroupByClause.
private void createSiddhiGroupByClause(BLangSelectClause select) {
BLangGroupBy groupBy = (BLangGroupBy) select.getGroupBy();
groupBy.accept(this);
}
Aggregations