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

Method testBzipStoreInMultiQuery

test/org/apache/pig/test/TestBZip.java:503–535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 12

createInputFileMethod · 0.95
setBatchOnMethod · 0.95
registerQueryMethod · 0.95
executeBatchMethod · 0.95
toConfigurationMethod · 0.95
getPigContextMethod · 0.95
deleteFileMethod · 0.95
getMethod · 0.65
getExecTypeMethod · 0.45
getPropertiesMethod · 0.45
listStatusMethod · 0.45

Tested by

no test coverage detected