use of com.hortonworks.streamline.streams.layout.component.rule.sql.ExpressionGenerator in project streamline by hortonworks.
the class RuleParser method parseCondition.
private Condition parseCondition(SqlSelect sqlSelect) {
Condition condition = null;
SqlNode where = sqlSelect.getWhere();
if (where != null) {
ExpressionGenerator exprGenerator = new ExpressionGenerator(streams, catalogUdfs);
condition = new Condition(where.accept(exprGenerator));
referredUdfs.addAll(exprGenerator.getReferredUdfs());
}
LOG.debug("Condition {}", condition);
return condition;
}
use of com.hortonworks.streamline.streams.layout.component.rule.sql.ExpressionGenerator 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.sql.ExpressionGenerator 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;
}
use of com.hortonworks.streamline.streams.layout.component.rule.sql.ExpressionGenerator in project streamline by hortonworks.
the class RuleParser method parseHaving.
private Having parseHaving(SqlSelect sqlSelect) {
Having having = null;
SqlNode sqlHaving = sqlSelect.getHaving();
if (sqlHaving != null) {
ExpressionGenerator exprGenerator = new ExpressionGenerator(streams, catalogUdfs);
having = new Having(sqlHaving.accept(exprGenerator));
referredUdfs.addAll(exprGenerator.getReferredUdfs());
}
LOG.debug("Having {}", having);
return having;
}
Aggregations