Hello All,
I am doing round trip of data from one table ( NIFI1) of an Oracle database to different table (NIFI2) if same database. Both tables have same structure.
CREATE TABLE INT_STG.NIFI1
(
ID INTEGER,
NAME VARCHAR2(100 BYTE),
UPDATED_DATE DATE
)
CREATE TABLE INT_STG.NIFI2
(
ID INTEGER,
NAME VARCHAR2(100 BYTE),
UPDATED_DATE DATE
)
In NIFI and using following design to move data:
QueryDatabaseTable ---> CovertRecord --> PutDatabaseRecord
I am getting " Inconsisdent datatype expected date got number" error in PutDatabaseRecord. Can someone please help me in finding out issue with the flow?
This is how data looks like between QueryDatabaseTable and ConvertRecord:
Objavro.schemaÈ{"type":"record","name":"NIFI1","namespace":"any.data","fields":[{"name":"ID","type":["null",{"type":"bytes","logicalType":"decimal","precision":38,"scale":0}]},{"name":"NAME","type":["null","string"]},{"name":"UPDATED_DATE","type":["null",{"type":"long","logicalType":"timestamp-millis"}]}]}�'»hd˦Ýhp/¬~a5j>
I�Ïó˜¡W'»hd˦Ýhp/¬~a5j>
This is how data looks like between CovertRecord and PutDatabaseRecord
I�Ïó˜¡W
Please note that
a) QueryDatabaseTable has "Use Avro Logical Types" = true
b) Convert Record has Record Reader as AvroReader with Schema Access Registry = Use Embedded Avro Schema and
RecordWriter = AvroRecordSetWriter with Schema Access Registry = "Use Schema Text Property" and Schema Text =
{
"type": "record",
"name": "ServiceStatusRecord",
"fields" : [
{"name": "ID", "type": "int"},
{"name": "NAME", "type": ["null", "string"]},
{"name": "UPDATED_DATE", "type": "long", "logicalType": "timestamp-millis"}
]
}
c) PutDatabaseRecord has AvroReader with Schema Access Strategy = "Use Schema Text Property" and Schema Text =
{
"type": "record",
"name": "ServiceStatusRecord",
"fields" : [
{"name": "ID", "type": "int"},
{"name": "NAME", "type": ["null", "string"]},
{"name": "UPDATED_DATE", "type": "long", "logicalType": "timestamp-millis"}
]
}
Here is the error I am getting
img-2739.jpg
Here is the flow in NiFi
Thanks in advance