MCPcopy Create free account
hub / github.com/apache/pig / testMAXAccumulate

Method testMAXAccumulate

test/org/apache/pig/test/TestBuiltin.java:1623–1638  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1621 }
1622
1623 @Test
1624 public void testMAXAccumulate() throws Exception {
1625 String[] maxTypes = {"MAX", "LongMax", "IntMax", "FloatMax", "BigDecimalMax", "BigIntegerMax", "StringMax", "DateTimeMax"};
1626 for (int k = 0; k < maxTypes.length; k++) {
1627 Accumulator<?> max = (Accumulator<?>)evalFuncMap.get(maxTypes[k]);
1628 String inputType = getInputType(maxTypes[k]);
1629 Tuple[] tuples = inputMapForAccumulate.get(inputType);
1630 for (Tuple tup : tuples)
1631 max.accumulate(tup);
1632 Object output = max.getValue();
1633
1634 String msg = "[Testing " + maxTypes[k] + " accumulate on input type: " + getInputType(maxTypes[k]) + " ( (output) " +
1635 output + " == " + getExpected(maxTypes[k]) + " (expected) )]";
1636 assertForInputType(inputType, msg, getExpected(maxTypes[k]), output);
1637 }
1638 }
1639
1640 @Test
1641 public void testMathFuncs() throws Exception {

Callers

nothing calls this directly

Calls 6

getInputTypeMethod · 0.95
getExpectedMethod · 0.95
assertForInputTypeMethod · 0.95
getMethod · 0.65
accumulateMethod · 0.65
getValueMethod · 0.65

Tested by

no test coverage detected