()
| 126 | } |
| 127 | |
| 128 | @Test |
| 129 | public void testMergeJoin() throws Exception { |
| 130 | PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE)); |
| 131 | w.println("A = load '" + INPUT_FILE + "';"); |
| 132 | w.println("B = load '" + EMPTY_DIR + "';"); |
| 133 | w.println("C = join A by $0, B by $0 using 'merge';"); |
| 134 | w.println("store C into '" + OUTPUT_FILE + "';"); |
| 135 | w.close(); |
| 136 | |
| 137 | try { |
| 138 | String[] args = { "-x", cluster.getExecType().name(), PIG_FILE, }; |
| 139 | PigStats stats = PigRunner.run(args, null); |
| 140 | |
| 141 | assertTrue(stats.isSuccessful()); |
| 142 | |
| 143 | // This assert fails on 205 due to MAPREDUCE-3606 |
| 144 | if (Util.isMapredExecType(cluster.getExecType()) |
| 145 | && !Util.isHadoop205() && !Util.isHadoop1_x()) { |
| 146 | // the indexer job has zero maps |
| 147 | MRJobStats js = (MRJobStats) stats.getJobGraph().getSources().get(0); |
| 148 | assertEquals(0, js.getNumberMaps()); |
| 149 | } |
| 150 | |
| 151 | assertEmptyOutputFile(); |
| 152 | } finally { |
| 153 | new File(PIG_FILE).delete(); |
| 154 | Util.deleteFile(cluster, OUTPUT_FILE); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | @Test |
| 159 | public void testFRJoin() throws Exception { |
nothing calls this directly
no test coverage detected