use of org.apache.phoenix.expression.aggregator.FirstLastValueServerAggregator in project phoenix by apache.
the class NthValueFunction method newServerAggregator.
@Override
public Aggregator newServerAggregator(Configuration conf) {
FirstLastValueServerAggregator aggregator = new FirstLastValueServerAggregator();
offset = ((Number) ((LiteralExpression) children.get(3)).getValue()).intValue();
boolean order = (Boolean) ((LiteralExpression) children.get(1)).getValue();
aggregator.init(children, order, offset);
return aggregator;
}
use of org.apache.phoenix.expression.aggregator.FirstLastValueServerAggregator in project phoenix by apache.
the class FirstValueFunction method newServerAggregator.
@Override
public Aggregator newServerAggregator(Configuration conf) {
FirstLastValueServerAggregator aggregator = new FirstLastValueServerAggregator();
boolean order = (Boolean) ((LiteralExpression) children.get(1)).getValue();
aggregator.init(children, order, 0);
return aggregator;
}
use of org.apache.phoenix.expression.aggregator.FirstLastValueServerAggregator in project phoenix by apache.
the class LastValueFunction method newServerAggregator.
@Override
public Aggregator newServerAggregator(Configuration conf) {
FirstLastValueServerAggregator aggregator = new FirstLastValueServerAggregator();
//invert order for LAST_BY function cause it is inverted version of FIRST_BY
boolean order = !(Boolean) ((LiteralExpression) children.get(1)).getValue();
aggregator.init(children, order, 0);
return aggregator;
}
Aggregations