Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-19869

Flink SQL JDBC connector for Postgres can't handle UUID datatype

    XMLWordPrintableJSON

Details

    • The Flink JDBC connector now supports writing UUIDs to Postgress databases.

    Description

      Problem:
      UUID is not a SQL standard type. But it is supported by Postgres as an internal type which postgres client will help to convert to java.util.UUID when queried. However, it seems flink doesn't support it as a sql extension in PostgresCatalog. There is no uuid serializer provided for it, either.  So if I want to filter a result set and put the filter result back to a table with same schema with uuid column type in it. I will have problem. 

      Proposal:
      Handle UUID in postgres as a SQL extension. Use the DataTypes.RAW to wrap its original class info and its serializer so as to expose it as a RAW JDBCType(only in postgres) in PostgresCatalog.
      And meanwhile, for PostgresRowConverter, we could use BinaryRawValueData to handle those SQL extension for byte serialization/deserialization. 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              RZ Jingwei Zhang
              Votes:
              6 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: