Search in sources :

Example 1 with TimeStampFunctionNode

use of com.yahoo.searchlib.expression.TimeStampFunctionNode in project vespa by vespa-engine.

the class ExpressionConverter method toTime.

private TimeStampFunctionNode toTime(GroupingExpression arg, TimeStampFunctionNode.TimePart timePart) {
    if (timeOffset == 0) {
        return new TimeStampFunctionNode(toExpressionNode(arg), timePart, true);
    }
    AddFunctionNode exp = new AddFunctionNode();
    exp.addArg(toExpressionNode(arg));
    exp.addArg(new ConstantNode(new IntegerResultNode(timeOffset)));
    return new TimeStampFunctionNode(exp, timePart, true);
}
Also used : AddFunctionNode(com.yahoo.searchlib.expression.AddFunctionNode) ConstantNode(com.yahoo.searchlib.expression.ConstantNode) IntegerResultNode(com.yahoo.searchlib.expression.IntegerResultNode) TimeStampFunctionNode(com.yahoo.searchlib.expression.TimeStampFunctionNode)

Aggregations

AddFunctionNode (com.yahoo.searchlib.expression.AddFunctionNode)1 ConstantNode (com.yahoo.searchlib.expression.ConstantNode)1 IntegerResultNode (com.yahoo.searchlib.expression.IntegerResultNode)1 TimeStampFunctionNode (com.yahoo.searchlib.expression.TimeStampFunctionNode)1