snuyanzin commented on code in PR #18604:
URL: https://github.com/apache/flink/pull/18604#discussion_r843885301
##########
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'm not sure... may be I didn't get your point about test for byte[].
Could you elaborate please here?
I'm asking because there is already an existing test for that (and it also
starts failing after update only pgjdbc version without other code changes)
```java
.column("bytea_arr", DataTypes.ARRAY(DataTypes.BYTES()))
...
+ "bytea_arr bytea[], "
...
+ "'{2,3,4}',"
```
at
https://github.com/apache/flink/blob/99c0438253efaf0a9626a807ce2b882402a367d1/flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/catalog/PostgresCatalogTestBase.java#L277
--
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]