Examples of evaluate()


Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDFDate.evaluate()

    ObjectInspector[] arguments = {valueOI};

    udf.initialize(arguments);
    DeferredObject valueObj = new DeferredJavaObject(new Text("2009-07-30"));
    DeferredObject[] args = {valueObj};
    Text output = (Text) udf.evaluate(args);

    assertEquals("to_date() test for STRING failed ", "2009-07-30", output.toString());

    // Try with null args
    DeferredObject[] nullArgs = { new DeferredJavaObject(null) };

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDFDateAdd.evaluate()

    udf.initialize(arguments);
    DeferredObject valueObj1 = new DeferredJavaObject(new Text("2009-07-20 04:17:52"));
    DeferredObject valueObj2 = new DeferredJavaObject(new Integer("2"));
    DeferredObject[] args = {valueObj1, valueObj2};
    Text output = (Text) udf.evaluate(args);

    assertEquals("date_add() test for STRING failed ", "2009-07-22", output.toString());

    // Test with null args
    args = new DeferredObject[] { new DeferredJavaObject(null), valueObj2 };

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDFDateDiff.evaluate()

    udf.initialize(arguments);
    DeferredObject valueObj1 = new DeferredJavaObject(new Text("2009-07-20"));
    DeferredObject valueObj2 = new DeferredJavaObject(new Text("2009-07-22"));
    DeferredObject[] args = {valueObj1, valueObj2};
    IntWritable output = (IntWritable) udf.evaluate(args);

    assertEquals("date_iff() test for STRING failed ", "-2", output.toString());

    // Test with null args
    args = new DeferredObject[] { new DeferredJavaObject(null), valueObj2 };

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDFDateSub.evaluate()

    // Test with null args
    args = new DeferredObject[] { new DeferredJavaObject(null), valueObj2 };
    assertNull("date_add() 1st arg null", udf.evaluate(args));

    args = new DeferredObject[] { valueObj1, new DeferredJavaObject(null) };
    assertNull("date_add() 2nd arg null", udf.evaluate(args));

    args = new DeferredObject[] { new DeferredJavaObject(null), new DeferredJavaObject(null) };
    assertNull("date_add() both args null", udf.evaluate(args));
  }

Examples of org.apache.hadoop.hive.ql.udf.generic.GenericUDFHash.evaluate()

            ObjectInspector udfInspector = udf.initialize(objectInspectors);
            checkArgument(udfInspector instanceof IntObjectInspector, "expected IntObjectInspector: %s", udfInspector);
            IntObjectInspector inspector = (IntObjectInspector) udfInspector;

            Object result = udf.evaluate(deferredObjects);
            HiveKey hiveKey = new HiveKey();
            hiveKey.setHashCode(inspector.get(result));

            int bucketNumber = new DefaultHivePartitioner<>().getBucket(hiveKey, null, bucketCount);

Examples of org.apache.hivemind.conditional.ClassNameEvaluator.evaluate()

        replayControls();

        ClassNameEvaluator e = new ClassNameEvaluator("foo.bar.Baz");

        assertEquals(true, e.evaluate(context, null));

        verifyControls();
    }

    public void testNotEvaluator()

Examples of org.apache.hivemind.conditional.Evaluator.evaluate()

        Evaluator evaluator = (Evaluator) control.getMock();
        EvaluationContext context = (EvaluationContext) newMock(EvaluationContext.class);

        Node n = new NodeImpl(evaluator);

        evaluator.evaluate(context, n);
        control.setReturnValue(false);

        evaluator.evaluate(context, n);
        control.setReturnValue(true);

Examples of org.apache.hivemind.conditional.Node.evaluate()

        try
        {
            Node node = _conditionalExpressionParser.parse(expression);

            return node.evaluate(new EvaluationContextImpl(module.getClassResolver()));
        }
        catch (RuntimeException ex)
        {
            _errorHandler.error(_log, ex.getMessage(), location, ex);

Examples of org.apache.hivemind.conditional.NodeImpl.evaluate()

        evaluator.evaluate(context, n);
        control.setReturnValue(true);

        replayControls();

        assertEquals(false, n.evaluate(context));
        assertEquals(true, n.evaluate(context));

        verifyControls();
    }
}

Examples of org.apache.hivemind.conditional.PropertyEvaluator.evaluate()

        replayControls();

        PropertyEvaluator pe = new PropertyEvaluator("foo.bar");

        assertEquals(true, pe.evaluate(context, null));

        verifyControls();
    }

    public void testClassNameEvaluator()
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.