This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.11.x
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit cfe1598641e0d760d695126add3fbe61a84a4f60
Author: Christian Zügner <[email protected]>
AuthorDate: Tue Feb 4 10:34:07 2020 +0100

    NIFI-7095: ResetSetRecordSet: handle java.sql.Array Types in normalizeValue 
method
    
    Some jdbc drivers e.g. Oracle returns java.sql.Array objects for array 
types, not just Lists.
    This commit also handles these cases, and extracts the primitive java 
arrays out of this jdbc holder class.
    
    Signed-off-by: Pierre Villard <[email protected]>
    
    This closes #4034.
---
 .../org/apache/nifi/serialization/record/ResultSetRecordSet.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java
 
b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java
index ee47c63..953b511 100644
--- 
a/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java
+++ 
b/nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/ResultSetRecordSet.java
@@ -128,7 +128,7 @@ public class ResultSetRecordSet implements RecordSet, 
Closeable {
     }
 
     @SuppressWarnings("rawtypes")
-    private Object normalizeValue(final Object value) {
+    private Object normalizeValue(final Object value) throws SQLException {
         if (value == null) {
             return null;
         }
@@ -137,6 +137,10 @@ public class ResultSetRecordSet implements RecordSet, 
Closeable {
             return ((List) value).toArray();
         }
 
+        if (value instanceof Array) {
+            return ((Array) value).getArray();
+        }
+
         return value;
     }
 

Reply via email to