snuyanzin commented on code in PR #18604:
URL: https://github.com/apache/flink/pull/18604#discussion_r843746214


##########
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/converter/PostgresRowConverter.java:
##########
@@ -91,7 +91,10 @@ private JdbcDeserializationConverter 
createPostgresArrayConverter(ArrayType arra
                 final Object[] array = (Object[]) 
Array.newInstance(elementClass, in.length);
                 for (int i = 0; i < in.length; i++) {
                     array[i] =
-                            elementConverter.deserialize(((PGobject) 
in[i]).getValue().getBytes());
+                            elementConverter.deserialize(
+                                    in[i] instanceof byte[]
+                                            ? in[i]
+                                            : ((PGobject) 
in[i]).getValue().getBytes());

Review Comment:
   I had a closer look to this method 
(_org.apache.flink.connector.jdbc.internal.converter.PostgresRowConverter#createPostgresArrayConverter_)
 and it has 2 separate ways of handling arrays depending on if it is byte[] or 
not. After https://github.com/pgjdbc/pgjdbc/pull/1194 Pg's byte[] is now 
handled as primitive byte array instead of PGObject. So I change it to handle 
byte[] same way as other array types



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to