Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.7.1
-
None
Description
line no:656
when record has some values,the code uses setObject for any value. that will raise error when the value is a Byte Array.
ps.setObject(i + 1, values[fieldIndexes.get(i)]);
to fix the problem ,use AvroTypeUtil.convertByteArray to convert the value to byte[] ,then setBytes will work OK.
if(field.getDataType().getFieldType() == RecordFieldType.ARRAY){ // byte need to be converted to bytearray ByteBuffer byteBufferValue = AvroTypeUtil.convertByteArray((Object[])values[fieldIndexes.get(i)]); ps.setBytes(i + 1, byteBufferValue.array()); }else { ps.setObject(i + 1, values[fieldIndexes.get(i)]); }
Attachments
Issue Links
- duplicates
-
NIFI-6409 Error inserting null fields in Teradata (through JDBC)
- Resolved