use of com.hortonworks.streamline.streams.layout.component.rule.expression.ExpressionList in project streamline by hortonworks.
the class RuleParser method parseProjection.
private Projection parseProjection(SqlSelect sqlSelect) {
Projection projection;
ExpressionGenerator exprGenerator = new ExpressionGenerator(streams, catalogUdfs);
ExpressionList exprList = (ExpressionList) sqlSelect.getSelectList().accept(exprGenerator);
if (exprList.getExpressions().size() == 1 && exprList.getExpressions().get(0) == STAR) {
projection = null;
} else {
projection = new Projection(exprList.getExpressions());
}
referredUdfs.addAll(exprGenerator.getReferredUdfs());
LOG.debug("Projection {}", projection);
return projection;
}
use of com.hortonworks.streamline.streams.layout.component.rule.expression.ExpressionList in project streamline by hortonworks.
the class RuleParser method parseGroupBy.
private GroupBy parseGroupBy(SqlSelect sqlSelect) {
GroupBy groupBy = null;
SqlNodeList sqlGroupBy = sqlSelect.getGroup();
if (sqlGroupBy != null) {
ExpressionGenerator exprGenerator = new ExpressionGenerator(streams, catalogUdfs);
ExpressionList exprList = (ExpressionList) sqlGroupBy.accept(exprGenerator);
groupBy = new GroupBy(exprList.getExpressions());
referredUdfs.addAll(exprGenerator.getReferredUdfs());
}
LOG.debug("GroupBy {}", groupBy);
return groupBy;
}
Aggregations