Search in sources :

Example 1 with EmptyColumnView

use of org.activityinfo.model.query.EmptyColumnView in project activityinfo by bedatadriven.

the class FunctionCallSlot method get.

@Override
public ColumnView get() {
    List<ColumnView> arguments = Lists.newArrayList();
    for (Slot<ColumnView> argument : argumentSlots) {
        ColumnView view = argument.get();
        if (view == null) {
            throw new IllegalStateException();
        }
        arguments.add(view);
    }
    try {
        return function.columnApply(arguments.get(0).numRows(), arguments);
    } catch (FormulaException e) {
        int numRows = arguments.get(0).numRows();
        return new EmptyColumnView(ColumnType.STRING, numRows);
    }
}
Also used : ColumnView(org.activityinfo.model.query.ColumnView) EmptyColumnView(org.activityinfo.model.query.EmptyColumnView) EmptyColumnView(org.activityinfo.model.query.EmptyColumnView) FormulaException(org.activityinfo.model.formula.diagnostic.FormulaException)

Aggregations

FormulaException (org.activityinfo.model.formula.diagnostic.FormulaException)1 ColumnView (org.activityinfo.model.query.ColumnView)1 EmptyColumnView (org.activityinfo.model.query.EmptyColumnView)1