* to output format implementation.
*/
@Override
protected void visit(LOStore store) throws PlanValidationException{
StoreFuncInterface sf = store.getStoreFunc();
String outLoc = store.getOutputFile().getFileName();
int errCode = 2116;
String validationErrStr ="Output Location Validation Failed for: " + outLoc ;
Job dummyJob;
try {
if(store.getSchema() != null){
sf.checkSchema(new ResourceSchema(store.getSchema(), store.getSortInfo()));
}
dummyJob = new Job(ConfigurationUtil.toConfiguration(pigCtx.getProperties()));
sf.setStoreLocation(outLoc, dummyJob);
} catch (IOException ioe) {
if(ioe instanceof PigException){
errCode = ((PigException)ioe).getErrorCode();
}
String exceptionMsg = ioe.getMessage();
validationErrStr += (exceptionMsg == null) ? "" : " More info to follow:\n" +exceptionMsg;
msgCollector.collect(validationErrStr, MessageType.Error) ;
throw new PlanValidationException(validationErrStr, errCode, pigCtx.getErrorSource(), ioe);
}
validationErrStr += " More info to follow:\n";
try {
sf.getOutputFormat().checkOutputSpecs(dummyJob);
} catch (IOException ioe) {
byte errSrc = pigCtx.getErrorSource();
switch(errSrc) {
case PigException.BUG:
errCode = 2002;