()
| 218 | |
| 219 | |
| 220 | @Before |
| 221 | public void setUp() throws Exception { |
| 222 | Util.resetStateForExecModeSwitch(); |
| 223 | |
| 224 | pigServer = new PigServer(Util.getLocalTestMode(), new Properties()); |
| 225 | pigServer.setValidateEachStatement(true); |
| 226 | // First set up data structs for "base" SUM, MIN and MAX and AVG. |
| 227 | // The allowed input and expected output data structs for |
| 228 | // the "Intermediate" and "Final" stages can be based on the |
| 229 | // "base" case - the allowed inputs for Initial stage can be based |
| 230 | // on the "base" case. In the test cases, the |
| 231 | // output of Initial is sent to Intermediate, so we don't |
| 232 | // explicitly test the output of Initial and hence do not |
| 233 | // need to set up expectedMap. |
| 234 | |
| 235 | // first set up EvalFuncMap and expectedMap |
| 236 | setupEvalFuncMap(); |
| 237 | |
| 238 | NULL_INPUT_TUPLE = TupleFactory.getInstance().newTuple(1); |
| 239 | NULL_INPUT_TUPLE.set(0, null); |
| 240 | |
| 241 | expectedMap.put("SUM", new Double(55)); |
| 242 | expectedMap.put("DoubleSum", new Double(170.567391834593)); |
| 243 | expectedMap.put("IntSum", new Long(55)); |
| 244 | expectedMap.put("LongSum", new Long(145776964666362L)); |
| 245 | expectedMap.put("FloatSum", new Double(56.15395)); |
| 246 | expectedMap.put("BigDecimalSum", new BigDecimal("99999999999999988.9999999999999999999999999999999999999999")); |
| 247 | expectedMap.put("BigIntegerSum", new BigInteger("999999999998888888887777777777777744444488888889999999999988")); |
| 248 | |
| 249 | expectedMap.put("AVG", new Double(5.5)); |
| 250 | expectedMap.put("DoubleAvg", new Double(17.0567391834593)); |
| 251 | expectedMap.put("LongAvg", new Double(14577696466636.2)); |
| 252 | expectedMap.put("IntAvg", new Double(5.5)); |
| 253 | expectedMap.put("FloatAvg", new Double(5.615394958853722)); |
| 254 | expectedMap.put("BigDecimalAvg", new BigDecimal("24999999999999997.25000000000000000")); |
| 255 | expectedMap.put("BigIntegerAvg", new BigDecimal("2.499999999997222222219444444444444E+59")); |
| 256 | |
| 257 | expectedMap.put("MIN", new Double(1)); |
| 258 | expectedMap.put("IntMin", new Integer(1)); |
| 259 | expectedMap.put("LongMin", new Long(2)); |
| 260 | expectedMap.put("FloatMin", new Float(0.09f)); |
| 261 | expectedMap.put("DoubleMin", new Double(0.000000834593)); |
| 262 | expectedMap.put("BigDecimalMin", BigDecimal.ZERO); |
| 263 | expectedMap.put("BigIntegerMin", BigInteger.ZERO); |
| 264 | expectedMap.put("StringMin", "input"); |
| 265 | expectedMap.put("DateTimeMin", new DateTime("2008-10-09T01:07:02.000Z")); |
| 266 | |
| 267 | expectedMap.put("MAX", new Double(10)); |
| 268 | expectedMap.put("IntMax", new Integer(10)); |
| 269 | expectedMap.put("LongMax", new Long(145769183483345L)); |
| 270 | expectedMap.put("FloatMax", new Float(10.4f)); |
| 271 | expectedMap.put("DoubleMax", new Double(121.0)); |
| 272 | expectedMap.put("BigDecimalMax", new BigDecimal("99999999999999977.9999999999999999999999999999999999999999")); |
| 273 | expectedMap.put("BigIntegerMax", new BigInteger("999999999998888888887777777777777744444488888889999999999977")); |
| 274 | expectedMap.put("StringMax", "unit"); |
| 275 | expectedMap.put("DateTimeMax", new DateTime("2014-12-25T11:11:11.000Z")); |
| 276 | |
| 277 | expectedMap.put("COUNT", new Long(10)); |
nothing calls this directly
no test coverage detected