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

Method testMergeJoin

test/org/apache/pig/test/TestEmptyInputDir.java:128–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 15

runMethod · 0.95
isSuccessfulMethod · 0.95
isMapredExecTypeMethod · 0.95
isHadoop205Method · 0.95
isHadoop1_xMethod · 0.95
getJobGraphMethod · 0.95
getNumberMapsMethod · 0.95
assertEmptyOutputFileMethod · 0.95
deleteFileMethod · 0.95
closeMethod · 0.65
nameMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected