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

Method runLoopTest

test/org/apache/pig/test/TestScriptLanguage.java:338–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

336 }
337
338 @Test
339 public void runLoopTest() throws Exception {
340 String[] script = {
341 "#!/usr/bin/python",
342 "from org.apache.pig.scripting import *",
343 "Pig.fs(\"rmr simple_out\")",
344 "Pig.fs(\"rmr simple_out2\")",
345 "input = 'simple_table_4'",
346 "P = Pig.compile(\"mypipeline\", \"\"\"a = load '$input';store a into '$output';\"\"\")",
347 "for x in [\"simple_out\", \"simple_out2\"]:",
348 "\tQ = P.bind({'input':input, 'output':x}).run()"
349 };
350 String[] input = {
351 "1\t3",
352 "2\t4",
353 "3\t5"
354 };
355
356 Util.createInputFile(cluster, "simple_table_4", input);
357
358 PigStats mainStats = runPigRunner("runLoopTest", script);
359
360 Map<String, List<PigStats>> statsMap = mainStats.getAllStats();
361 assertEquals(1, statsMap.size());
362 assertEquals("mypipeline", statsMap.keySet().iterator().next());
363 List<PigStats> lst = statsMap.get("mypipeline");
364 assertEquals(2, lst.size());
365 for (PigStats stats : lst) {
366 assertTrue("job should succeed", stats.isSuccessful());
367 assertEquals(1, stats.getNumberJobs());
368 assertEquals(12, stats.getBytesWritten());
369 assertEquals(3, stats.getRecordWritten());
370 }
371 }
372
373 @Test
374 public void bindLocalVariableTest() throws Exception {

Callers

nothing calls this directly

Calls 13

createInputFileMethod · 0.95
runPigRunnerMethod · 0.95
getAllStatsMethod · 0.95
sizeMethod · 0.65
iteratorMethod · 0.65
getMethod · 0.65
assertEqualsMethod · 0.45
nextMethod · 0.45
keySetMethod · 0.45
isSuccessfulMethod · 0.45
getNumberJobsMethod · 0.45
getBytesWrittenMethod · 0.45

Tested by

no test coverage detected