@Override public final void checkSchema(final ResourceSchema rs) throws IOException { if (rs == null) { throw new IOException("checkSchema: called with null ResourceSchema"); } Schema avroSchema = AvroStorageSchemaConversionUtilities .resourceSchemaToAvroSchema(rs, (schemaName == null || schemaName.length() == 0) ? "pig_output" : schemaName, schemaNameSpace, Maps.<String, List<Schema>> newHashMap(), doubleColonsToDoubleUnderscores); if (avroSchema == null) { throw new IOException("checkSchema: could not translate ResourceSchema to Avro Schema"); } setOutputAvroSchema(avroSchema); }
setOutputAvroSchema(s); } catch (SchemaParseException e) { .parse((FileSystem.get(p.toUri(), conf).open(p))); setInputAvroSchema(s); setOutputAvroSchema(s); } catch (FileNotFoundException fnfe) { System.err.printf("file not found exception\n"); Schema s = ((GenericContainer) Class.forName(schemaClass).newInstance()).getSchema(); setInputAvroSchema(s); setOutputAvroSchema(s); } catch (ClassNotFoundException | IllegalAccessException cnfe) { System.err.printf("class not found exception\n"); setOutputAvroSchema( getAvroSchema(configuredOptions.getOptionValue('e'), new Job(new Configuration())));