()
| 66 | } |
| 67 | |
| 68 | @Test |
| 69 | public void testGroupBy() throws Exception { |
| 70 | PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE)); |
| 71 | w.println("A = load '" + EMPTY_DIR + "';"); |
| 72 | w.println("B = group A by $0;"); |
| 73 | w.println("store B into '" + OUTPUT_FILE + "';"); |
| 74 | w.close(); |
| 75 | |
| 76 | try { |
| 77 | String[] args = { "-x", cluster.getExecType().name(), PIG_FILE, }; |
| 78 | PigStats stats = PigRunner.run(args, null); |
| 79 | |
| 80 | assertTrue(stats.isSuccessful()); |
| 81 | |
| 82 | // This assert fails on 205 due to MAPREDUCE-3606 |
| 83 | if (Util.isMapredExecType(cluster.getExecType()) |
| 84 | && !Util.isHadoop205() && !Util.isHadoop1_x()) { |
| 85 | MRJobStats js = (MRJobStats) stats.getJobGraph().getSources().get(0); |
| 86 | assertEquals(0, js.getNumberMaps()); |
| 87 | } |
| 88 | |
| 89 | //Spark doesn't create an empty result file part-*, only a _SUCCESS file if input dir was empty |
| 90 | Assume.assumeTrue("Skip this test for Spark. See PIG-5140", !Util.isSparkExecType(cluster.getExecType())); |
| 91 | assertEmptyOutputFile(); |
| 92 | } finally { |
| 93 | new File(PIG_FILE).delete(); |
| 94 | Util.deleteFile(cluster, OUTPUT_FILE); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | @Test |
| 99 | public void testSkewedJoin() throws Exception { |
nothing calls this directly
no test coverage detected