You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/09/12 13:54:33 UTC

[GitHub] [flink] MartijnVisser commented on a diff in pull request #20048: [FLINK-19869][connectors/jdbc] Add support for postgres UUID type

MartijnVisser commented on code in PR #20048:
URL: https://github.com/apache/flink/pull/20048#discussion_r968451789


##########
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/converter/PostgresRowConverter.java:
##########
@@ -59,6 +63,25 @@ public JdbcDeserializationConverter createInternalConverter(LogicalType type) {
         }
     }
 
+    @Override
+    protected JdbcSerializationConverter createExternalConverter(LogicalType type) {
+        switch (type.getTypeRoot()) {
+            case CHAR:
+            case VARCHAR:
+                return (val, index, statement) -> {
+                    String valString = val.getString(index).toString();
+
+                    if (UUID_REGEX_PATTERN.matcher(valString).matches()) {

Review Comment:
   @bobby-richard After discussing this issue with @twalthr offline, we agreed that we indeed have to revert this change. The inefficiency and potential error cases are the driver for that. @twalthr has a different idea to resolve this, he'll create a fix for this soonish. Apologies for this situation. 



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org