use of org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangSelectClause selectClause) {
GroupByNode groupByNode = selectClause.getGroupBy();
if (groupByNode != null) {
((BLangGroupBy) groupByNode).accept(this);
}
HavingNode havingNode = selectClause.getHaving();
if (havingNode != null) {
((BLangHaving) havingNode).accept(this);
}
List<? extends SelectExpressionNode> selectExpressionsList = selectClause.getSelectExpressions();
if (selectExpressionsList != null) {
for (SelectExpressionNode selectExpressionNode : selectExpressionsList) {
((BLangSelectExpression) selectExpressionNode).accept(this);
}
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method visit.
@Override
public void visit(BLangGroupBy groupBy) {
List<? extends ExpressionNode> varList = groupBy.getVariables();
Iterator<? extends ExpressionNode> iterator = varList.iterator();
groupByClause = new StringBuilder("group by ");
BLangSimpleVarRef simpleVarRef = (BLangSimpleVarRef) iterator.next();
addVarRefToClauseBuilder(simpleVarRef, groupByClause);
while (iterator.hasNext()) {
simpleVarRef = (BLangSimpleVarRef) iterator.next();
groupByClause.append(", ");
addVarRefToClauseBuilder(simpleVarRef, groupByClause);
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy in project ballerina by ballerina-lang.
the class SqlQueryBuilder method visit.
@Override
public void visit(BLangGroupBy groupBy) {
List<? extends ExpressionNode> varList = groupBy.getVariables();
Iterator<? extends ExpressionNode> iterator = varList.iterator();
groupByClause = new StringBuilder("group by ");
BLangExpression expr = (BLangExpression) iterator.next();
expr.accept(this);
groupByClause.append(exprStack.pop());
while (iterator.hasNext()) {
expr = (BLangExpression) iterator.next();
groupByClause.append(", ");
expr.accept(this);
groupByClause.append(exprStack.pop());
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy 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.BLangGroupBy 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);
}
}
Aggregations