Member since
11-28-2022
4
Posts
0
Kudos Received
0
Solutions
12-07-2022
02:40 PM
@mburgess I have the same problem. The code was written in jython. from org.apache.commons.io import IOUtils from java.nio.charset import StandardCharsets from org.apache.nifi.processor.io import OutputStreamCallback from java.lang import Object # Define a subclass of OutputStreamCallback for use in session.write() class PyOutputStreamCallback(OutputStreamCallback): def __init__(self, cadena): self.cadena = cadena def process(self, outputStream): outputStream.write(bytearray(self.cadena.encode('utf-8'))) # end class flowFile = session.get() if (flowFile != None): table = flowFile.getAttribute('table_name') if (table != 'database_1.dbo.dtproperties'): newFlowFile = session.create(flowFile) newFFC = '' newFlowFile = session.write(newFlowFile, PyOutputStreamCallback(newFFC)) session.transfer(newFlowFile, REL_SUCCESS) elif (table == 'database_1.dbo.dtproperties'): session.remove(flowFile) else: session.transfer(flowFile, REL_FAILURE) I'm understanding that flow files are passing one by one, right? So if there is a flow file with an attribute ''database_1.dbo.dtproperties" should be eliminated without affecting other flow files. But I got "flowfile has already marked for removal"
... View more
12-01-2022
09:33 AM
I had a problem when I runned Execute SQL processor; it says that a column which has date values can not be converted to avro format. So I want to know how read attributes of this processor work and if the parameter sql.args.N.format can solve the problem.
... View more
Labels:
- Labels:
-
Apache NiFi
11-28-2022
08:39 PM
Hi, everyone. I'm learning about some NiFi processors. I want to obtain all the data of several tables automatically. So I used a ListDatabaseTable processor with the aim of getting the tables names that are in a specific catalog. After that, I used other processors to generate the queries like GenerateTableFetch and RemplaceText. Everything works perfectly since here. Finally, ExecuteSQL processor plays a role, and here and error is displayed. It says that a datetime column can not be converted to Avro format. The problem is that there are several tables so specify those columns would be complicated to cast them. Is a possible solution to fix the error? The connection is with Microsoft SQL Server.
... View more
Labels:
- Labels:
-
NiFi Registry