()
| 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 { |
nothing calls this directly
no test coverage detected