()
| 501 | } |
| 502 | |
| 503 | @Test |
| 504 | public void testBzipStoreInMultiQuery() throws Exception { |
| 505 | String[] inputData = new String[] { |
| 506 | "1\t2\r3\t4" |
| 507 | }; |
| 508 | |
| 509 | try { |
| 510 | String inputFileName = "input.txt"; |
| 511 | Util.createInputFile(cluster, inputFileName, inputData); |
| 512 | |
| 513 | PigServer pig = new PigServer(cluster.getExecType(), properties); |
| 514 | |
| 515 | pig.setBatchOn(); |
| 516 | pig.registerQuery("a = load '" + inputFileName + "';"); |
| 517 | pig.registerQuery("store a into 'output.bz2';"); |
| 518 | pig.registerQuery("store a into 'output';"); |
| 519 | pig.executeBatch(); |
| 520 | |
| 521 | FileSystem fs = FileSystem.get(ConfigurationUtil.toConfiguration( |
| 522 | pig.getPigContext().getProperties())); |
| 523 | FileStatus[] outputFiles = fs.listStatus(new Path("output"), |
| 524 | Util.getSuccessMarkerPathFilter()); |
| 525 | assertTrue(outputFiles[0].getLen() > 0); |
| 526 | |
| 527 | outputFiles = fs.listStatus(new Path("output.bz2"), |
| 528 | Util.getSuccessMarkerPathFilter()); |
| 529 | assertTrue(outputFiles[0].getLen() > 0); |
| 530 | } finally { |
| 531 | Util.deleteFile(cluster, "input.txt"); |
| 532 | Util.deleteFile(cluster, "output.bz2"); |
| 533 | Util.deleteFile(cluster, "output"); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | @Test |
| 538 | public void testBzipStoreInMultiQuery2() throws Exception { |
nothing calls this directly
no test coverage detected