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

Method secondTest

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

Source from the content-addressed store, hash-verified

141 }
142
143 @Test
144 public void secondTest() throws Exception {
145 String[] script = {
146 "#!/usr/bin/python",
147 "from org.apache.pig.scripting import *",
148 "Pig.fs(\"rmr simple_out\")",
149 "input = 'simple_table_6'",
150 "output = 'simple_out'",
151 "P = Pig.compileFromFile(\"\"\"secondTest.pig\"\"\")",
152 "Q = P.bind({'input':input, 'output':output})",
153 "stats = Q.runSingle()",
154 "if stats.isSuccessful():",
155 "\tprint 'success!'",
156 "else:",
157 "\traise 'failed'"
158 };
159 String[] input = {
160 "1\t3",
161 "2\t4",
162 "3\t5"
163 };
164
165 String[] pigLatin = {
166 "-- ensure comment parsed correctly",
167 "a = load '$input';",
168 "store a into '$output';"
169 };
170
171 Util.createInputFile(cluster, "simple_table_6", input);
172 Util.createLocalInputFile( "secondTest.pig", pigLatin);
173
174 PigStats stats = runSimpleScript("secondTest", script);
175 assertEquals(1, stats.getNumberJobs());
176 String name = stats.getOutputNames().get(0);
177 assertEquals("simple_out", name);
178 assertEquals(12, stats.getBytesWritten());
179 assertEquals(3, stats.getRecordWritten());
180 }
181
182 @Test
183 public void firstParallelTest() throws Exception {

Callers

nothing calls this directly

Calls 9

createInputFileMethod · 0.95
createLocalInputFileMethod · 0.95
runSimpleScriptMethod · 0.95
getNumberJobsMethod · 0.95
getOutputNamesMethod · 0.95
getBytesWrittenMethod · 0.95
getRecordWrittenMethod · 0.95
getMethod · 0.65
assertEqualsMethod · 0.45

Tested by

no test coverage detected