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

Method testStoreLoadSplit

test/org/apache/pig/tez/TestTezCompiler.java:177–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175 }
176
177 @Test
178 public void testStoreLoadSplit() throws Exception {
179 // Cases where segmenting into two DAGs is not straight forward due to Split.
180 // The Split operator is required in both the segments.
181
182 resetFileLocalizer();
183 // Split operator as root vertex
184 String query =
185 "a = load 'file:///tmp/input';" +
186 "a1 = filter a by $0 == 5;" +
187 "store a1 into 'file:///tmp/pigoutput/Dir1';" +
188 "b = load 'file:///tmp/pigoutput/Dir1';" +
189 "c = join a by $0, b by $0;" +
190 "store c into 'file:///tmp/pigoutput/Dir2';";
191
192 run(query, "test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-LoadStore-5.gld");
193
194 // Split operator as intermediate vertex
195 query =
196 "a = load 'file:///tmp/input';" +
197 "a = distinct a;" +
198 "store a into 'file:///tmp/pigoutput/Dir1';" +
199 "b = load 'file:///tmp/pigoutput/Dir1';" +
200 "c = join a by $0, b by $0;" +
201 "store c into 'file:///tmp/pigoutput/Dir2';";
202
203 resetScope();
204 resetFileLocalizer();
205 run(query, "test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-LoadStore-6.gld");
206
207 // Three levels of splits - a, a1 and a2.
208 // One split above and one split below a1 which is the split to be replaced with tmp store.
209 query =
210 "a = load 'file:///tmp/input';" +
211 "store a into 'file:///tmp/pigoutput/Dir0';" +
212 "a1 = filter a by $0 == 5;" +
213 "store a1 into 'file:///tmp/pigoutput/Dir1';" +
214 "a2 = distinct a1;" +
215 "store a2 into 'file:///tmp/pigoutput/Dir2';" +
216 "a3 = group a2 by $0;" +
217 "store a3 into 'file:///tmp/pigoutput/Dir3';" +
218 "b = load 'file:///tmp/pigoutput/Dir3';" +
219 "c = join a1 by $0, b by $0;" +
220 "store c into 'file:///tmp/pigoutput/Dir4';";
221
222 resetScope();
223 resetFileLocalizer();
224 run(query, "test/org/apache/pig/test/data/GoldenFiles/tez/TEZC-LoadStore-7.gld");
225 }
226
227 @Test
228 public void testNative() throws Exception {

Callers

nothing calls this directly

Calls 3

resetFileLocalizerMethod · 0.95
runMethod · 0.95
resetScopeMethod · 0.95

Tested by

no test coverage detected