本文整理汇总了Java中org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException类的典型用法代码示例。如果您正苦于以下问题:Java JobCreationException类的具体用法?Java JobCreationException怎么用?Java JobCreationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JobCreationException类属于org.apache.pig.backend.hadoop.executionengine.mapReduceLayer包,在下文中一共展示了JobCreationException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGlob6
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testGlob6() throws IOException {
// Verify that an IOException is thrown if no files are matched by the glob pattern.
String output = outbasedir + "testGlob6";
deleteDirectory(new File(output));
String [] queries = {
" in = LOAD '" + Util.encodeEscape(testNoMatchedFiles) + "' USING org.apache.pig.piggybank.storage.avro.AvroStorage ();",
" STORE in INTO '" + output + "' USING org.apache.pig.piggybank.storage.avro.AvroStorage (" +
" 'schema', '{\"type\":\"array\",\"items\":\"float\"}' );"
};
try {
testAvroStorage(queries);
Assert.fail("Negative test to test an exception. Should not be succeeding!");
} catch (JobCreationException e) {
// The IOException thrown by AvroStorage for input file not found is catched
// by the Pig backend, and JobCreationException (a subclass of IOException)
// is re-thrown while creating a job configuration.
assertEquals(e.getMessage(), "Internal error creating job configuration.");
}
}
示例2: testJobControlCompilerErr
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testJobControlCompilerErr() throws Exception {
String query = "a = load 'input';" + "b = order a by $0;" + "store b into 'output';";
PigServer pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
PhysicalPlan pp = Util.buildPp(pigServer, query);
POStore store = GenPhyOp.dummyPigStorageOp();
pp.addAsLeaf(store);
MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
for(MapReduceOper mro: mrPlan.getLeaves()) {
if(mro.reducePlan != null) {
PhysicalOperator po = mro.reducePlan.getRoots().get(0);
if(po instanceof POPackage) {
((POPackage)po).setKeyType(DataType.BAG);
mro.setGlobalSort(true);
}
}
}
ConfigurationValidator.validatePigProperties(pc.getProperties());
Configuration conf = ConfigurationUtil.toConfiguration(pc.getProperties());
JobControlCompiler jcc = new JobControlCompiler(pc, conf);
try {
jcc.compile(mrPlan, "Test");
} catch (JobCreationException jce) {
assertTrue(jce.getErrorCode() == 1068);
}
}
示例3: testJobControlCompilerErr
import org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException; //导入依赖的package包/类
@Test
public void testJobControlCompilerErr() throws Exception {
String query = "a = load 'input';" + "b = order a by $0;" + "store b into 'output';";
PigServer pigServer = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
PhysicalPlan pp = Util.buildPp(pigServer, query);
POStore store = GenPhyOp.dummyPigStorageOp();
pp.addAsLeaf(store);
MROperPlan mrPlan = Util.buildMRPlan(pp, pc);
for(MapReduceOper mro: mrPlan.getLeaves()) {
if(mro.reducePlan != null) {
PhysicalOperator po = mro.reducePlan.getRoots().get(0);
if(po instanceof POPackage) {
((POPackage)po).setKeyType(DataType.BAG);
mro.setGlobalSort(true);
}
}
}
ConfigurationValidator.validatePigProperties(pc.getProperties());
Configuration conf = ConfigurationUtil.toConfiguration(pc.getProperties());
JobControlCompiler jcc = new JobControlCompiler(pc, conf);
try {
jcc.compile(mrPlan, "Test");
} catch (JobCreationException jce) {
assertTrue(jce.getErrorCode() == 1068);
}
}