/** Check that schema is reasonable and serialize the field names as a string for later use. */ @Override public void checkSchema(ResourceSchema s) throws IOException { UDFContext context = UDFContext.getUDFContext(); Properties property = context.getUDFProperties(ResourceSchema.class); String fieldNames = ""; for (String field : s.fieldNames()) { fieldNames += field; fieldNames += COMMA; } property.setProperty(PIG_ES_FIELD_NAMES, fieldNames); }
/** Here we set the field names for a given tuple even if we */ @Override public void checkSchema(ResourceSchema s) throws IOException { UDFContext context = UDFContext.getUDFContext(); Properties property = context.getUDFProperties(ResourceSchema.class); String fieldNames = ""; for (String field : s.fieldNames()) { fieldNames += field; fieldNames += COMMA; } property.setProperty(PIG_ES_FIELD_NAMES, fieldNames); }
OutputStream os = headerFilePath.create(); try { String[] names = schema.fieldNames(); String fn; for (int i=0; i < names.length; i++) {