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

pvillard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 98f9b7c  NIFI-7095: ResetSetRecordSet: handle java.sql.Array Types in 
normalizeValue method
98f9b7c is described below

commit 98f9b7c033a8d80ddf43aa77f63107703077d297
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