i write a nifi custom processor that handle xlsx to csv , and in my code i generate a string csv like this from xlsx, but i don“t know how to send it as csv, and the other processors like inferavroschema from csv can recognize the inpustream as csv.
final AtomicReference<String> value = new AtomicReference<>();
String csvToString= "
name,age,info
javo,23,wasa
pepe,34,lima"
value.set(csvToString);
And in my code i send it in this way, but when i see the data provenance it apears as content type text:
String results = value.get();
if(results != null && !results.isEmpty()){
flowFile = session.putAttribute(flowFile, "csv", results);
}
flowFile = session.write(flowFile, new OutputStreamCallback() {
@Override
public void process(OutputStream out) throws IOException {
out.write(value.get().getBytes());
}
});
session.transfer(flowFile, SUCCESS);