Henrik
Henrik

Reputation: 9915

Flink JDBC UUID – source connector

In Flink 1.15, I want to read a column that is typed with the Postgres UUID type (the id column).

However, this does not work; crashes with The PostgreSQL dialect doesn't support type: RAW('java.lang.String', '...') NOT NULL. How can I interpret all id results as a plain string?

screenshot of code

Upvotes: 2

Views: 479

Answers (1)

Henrik
Henrik

Reputation: 9915

            TableDescriptor.forConnector("jdbc")
                    .schema(
                            Schema.newBuilder()
                                    .column("app_id", DataTypes.STRING().notNull())
                                    .column("moniker", DataTypes.STRING().notNull())
                                    .columnByExpression("a_proctime", "PROCTIME()")
                                    .primaryKey("app_id")
                                    .build())

Upvotes: 2

Related Questions