Examples of evaluate()


Examples of org.apache.phoenix.expression.DecimalMultiplyExpression.evaluate()

        op1 = LiteralExpression.newConstant(new BigDecimal("12345"), PDataType.DECIMAL, 5, 0);
        op2 = LiteralExpression.newConstant(new BigDecimal("123.45"), PDataType.DECIMAL, 5, 2);
        children = Arrays.<Expression>asList(op1, op2);
        e = new DecimalMultiplyExpression(children);
        ptr = new ImmutableBytesWritable();
        evaluated = e.evaluate(null, ptr);
        assertTrue(evaluated);
        assertEqualValue(PDataType.DECIMAL, new BigDecimal("1523990.25"), ptr);

        // Value too big, exceeds precision.
        op1 = LiteralExpression.newConstant(new BigDecimal("12345678901234567890123456789012345678"), PDataType.DECIMAL, 38, 0);

Examples of org.apache.phoenix.expression.DecimalSubtractExpression.evaluate()

        op1 = LiteralExpression.newConstant(new BigDecimal("1234567890123456789012345678901"), PDataType.DECIMAL, 31, 0);
        op2 = LiteralExpression.newConstant(new BigDecimal("12345"), PDataType.DECIMAL, 5, 0);
        children = Arrays.<Expression>asList(op1, op2);
        e = new DecimalSubtractExpression(children);
        ptr = new ImmutableBytesWritable();
        evaluated = e.evaluate(null, ptr);
        assertTrue(evaluated);
        assertEqualValue(PDataType.DECIMAL, new BigDecimal("1234567890123456789012345666556"), ptr);

        op1 = LiteralExpression.newConstant(new BigDecimal("12345"), PDataType.DECIMAL, 5, 0);
        op2 = LiteralExpression.newConstant(new BigDecimal("123.45"), PDataType.DECIMAL, 5, 2);

Examples of org.apache.phoenix.expression.Expression.evaluate()

       
        ArrayConstructorExpression arrayExpression = new ArrayConstructorExpression(children, arrayElemDataType);
        if (ExpressionUtil.isConstant(arrayExpression)) {
            for (int i = 0; i < children.size(); i++) {
                Expression child = children.get(i);
                child.evaluate(null, ptr);
                Object value = arrayElemDataType.toObject(ptr, child.getDataType(), child.getSortOrder());
                elements[i] = LiteralExpression.newConstant(value, child.getDataType(), child.isDeterministic()).getValue();
            }
            Object value = PArrayDataType.instantiatePhoenixArray(arrayElemDataType, elements);
            return LiteralExpression.newConstant(value,

Examples of org.apache.phoenix.expression.KeyValueColumnExpression.evaluate()

                // Using KeyValueSchema to set and retrieve the value
                // collect the first kv to get the row
                KeyValue rowKv = result.get(0);
                for (int i = 0; i < arrayKVRefs.size(); i++) {
                    KeyValueColumnExpression kvExp = arrayKVRefs.get(i);
                    if (kvExp.evaluate(tuple, ptr)) {
                        for (int idx = tuple.size() - 1; idx >= 0; idx--) {
                            KeyValue kv = tuple.getValue(idx);
                            if (Bytes.equals(kvExp.getColumnFamily(), kv.getFamily())
                                    && Bytes.equals(kvExp.getColumnName(), kv.getQualifier())) {
                                // remove the kv that has the full array values.

Examples of org.apache.phoenix.expression.LikeExpression.evaluate()

            }
        }
        Expression expression = new LikeExpression(children);
        if (ExpressionUtil.isConstant(expression)) {
            ImmutableBytesWritable ptr = context.getTempPtr();
            if (!expression.evaluate(null, ptr)) {
                return LiteralExpression.newConstant(null, expression.isDeterministic());
            } else {
                return LiteralExpression.newConstant(Boolean.TRUE.equals(PDataType.BOOLEAN.toObject(ptr)) ^ node.isNegate(), expression.isDeterministic());
            }
        }

Examples of org.apache.phoenix.expression.StringConcatExpression.evaluate()

        for (Expression child:children) {
            isLiteralExpression&=(child instanceof LiteralExpression);
        }
        ImmutableBytesWritable ptr = context.getTempPtr();
        if (isLiteralExpression) {
            expression.evaluate(null,ptr);
            return LiteralExpression.newConstant(expression.getDataType().toObject(ptr));
        }
        return wrapGroupByExpression(expression);
    }

Examples of org.apache.phoenix.expression.function.FunctionExpression.evaluate()

        FunctionExpression func = node.create(children, context);
        if (node.isConstant()) {
            ImmutableBytesWritable ptr = context.getTempPtr();
            Object value = null;
            PDataType type = func.getDataType();
            if (func.evaluate(null, ptr)) {
                value = type.toObject(ptr);
            }
            return LiteralExpression.newConstant(value, type);
        }
        BuiltInFunctionInfo info = node.getInfo();

Examples of org.apache.pluto.tags.el.ExpressionEvaluatorProxy.evaluate()

     * evaluated result to <code>evaluatedPortletId</code>
     * @throws JspException  if an error occurs.
     */
    private void evaluatePortletId() throws JspException {
        ExpressionEvaluatorProxy proxy = ExpressionEvaluatorProxy.getProxy();
        Object obj = proxy.evaluate(portletId, pageContext);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Evaluated portletId to: " + obj);
        }
        evaluatedPortletId = (String) obj;
    }

Examples of org.apache.poi.hssf.record.formula.eval.OperationEval.evaluate()

                // storing the ops in reverse order since they are popping
                for (int j = numops - 1; j >= 0; j--) {
                    Eval p = (Eval) stack.pop();
                    ops[j] = p;
                }
                Eval opresult = operation.evaluate(ops, srcRowNum, srcColNum);
                stack.push(opresult);
            }
            else if (ptgs[i] instanceof ReferencePtg) {
                ReferencePtg ptg = (ReferencePtg) ptgs[i];
                short colnum = ptg.getColumn();

Examples of org.apache.poi.hssf.record.formula.functions.FreeRefFunction.evaluate()

          + nameArg.getClass().getName() + ")");
    }
    int nOutGoingArgs = nIncomingArgs -1;
    Eval[] outGoingArgs = new Eval[nOutGoingArgs];
    System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
    return targetFunc.evaluate(outGoingArgs, workbook, srcCellSheet, srcCellRow, srcCellCol);
  }

  private static FreeRefFunction findExternalUserDefinedFunction(EvaluationWorkbook workbook,
      NameXEval n) {
    String functionName = workbook.resolveNameXText(n.getPtg());
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.