Search in sources :

Example 6 with FunctionExpression

use of com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression in project cobar by alibaba.

the class Dimension2PartitionFunction method constructFunction.

@Override
public FunctionExpression constructFunction(List<Expression> arguments) {
    if (arguments == null || arguments.size() != 2)
        throw new IllegalArgumentException("function " + getFunctionName() + " must have 2 arguments but is " + arguments);
    Object[] args = new Object[arguments.size()];
    int i = -1;
    for (Expression arg : arguments) {
        args[++i] = arg;
    }
    return (FunctionExpression) constructMe(args);
}
Also used : FunctionExpression(com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression) FunctionExpression(com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression) Expression(com.alibaba.cobar.parser.ast.expression.Expression)

Example 7 with FunctionExpression

use of com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression in project cobar by alibaba.

the class PartitionByString method constructFunction.

@Override
public FunctionExpression constructFunction(List<Expression> arguments) {
    if (arguments == null || arguments.size() != 1) {
        throw new IllegalArgumentException("function " + getFunctionName() + " must have 1 argument but is " + arguments);
    }
    Object[] args = new Object[arguments.size()];
    int i = -1;
    for (Expression arg : arguments) {
        args[++i] = arg;
    }
    return (FunctionExpression) constructMe(args);
}
Also used : FunctionExpression(com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression) FunctionExpression(com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression) Expression(com.alibaba.cobar.parser.ast.expression.Expression)

Aggregations

FunctionExpression (com.alibaba.cobar.parser.ast.expression.primary.function.FunctionExpression)7 Expression (com.alibaba.cobar.parser.ast.expression.Expression)5 ArithmeticAddExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticAddExpression)1 ArithmeticDivideExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticDivideExpression)1 ArithmeticIntegerDivideExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticIntegerDivideExpression)1 ArithmeticModExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticModExpression)1 ArithmeticMultiplyExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticMultiplyExpression)1 ArithmeticSubtractExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.ArithmeticSubtractExpression)1 MinusExpression (com.alibaba.cobar.parser.ast.expression.arithmeic.MinusExpression)1 BitAndExpression (com.alibaba.cobar.parser.ast.expression.bit.BitAndExpression)1 BitInvertExpression (com.alibaba.cobar.parser.ast.expression.bit.BitInvertExpression)1 BitOrExpression (com.alibaba.cobar.parser.ast.expression.bit.BitOrExpression)1 BitShiftExpression (com.alibaba.cobar.parser.ast.expression.bit.BitShiftExpression)1 BitXORExpression (com.alibaba.cobar.parser.ast.expression.bit.BitXORExpression)1 BetweenAndExpression (com.alibaba.cobar.parser.ast.expression.comparison.BetweenAndExpression)1 ComparisionEqualsExpression (com.alibaba.cobar.parser.ast.expression.comparison.ComparisionEqualsExpression)1 ComparisionGreaterThanExpression (com.alibaba.cobar.parser.ast.expression.comparison.ComparisionGreaterThanExpression)1 ComparisionGreaterThanOrEqualsExpression (com.alibaba.cobar.parser.ast.expression.comparison.ComparisionGreaterThanOrEqualsExpression)1 ComparisionIsExpression (com.alibaba.cobar.parser.ast.expression.comparison.ComparisionIsExpression)1 ComparisionLessOrGreaterThanExpression (com.alibaba.cobar.parser.ast.expression.comparison.ComparisionLessOrGreaterThanExpression)1