首页 > 解决方案 > 使用 Apache NiFi 加载 postgres 表时出现 UUID 数据类型问题

问题描述

数据库

尼菲

问题描述

使用 ExecuteSQL 处理器调度表时,会出现以下错误消息:

ExecuteSQL[id=09033e32-e840-1aed-3062-6e8cbc5551ba] ExecuteSQL[id=09033e32-e840-1aed-3062-6e8cbc5551ba] 由于 createSchema 无法处理会话:未知 SQL 类型 1111 / uuid(表:国家,列:id ) 不能转换为 Avro 类型;处理器在管理上产生了 1 秒:java.lang.IllegalArgumentException:createSchema:未知 SQL 类型 1111 / uuid(表:国家,列:id)无法转换为 Avro 类型

请注意,流文件不会从传入队列中删除,也不会发送到“失败”关系,从而导致失败尝试的无限循环。

尝试修复问题

可能但不是首选的解决方案

最后一点

标签: postgresqluuidavroapache-nifi

解决方案


I believe UUID is not a standard JDBC type and is specific to Postgres.

The JDBC types class shows that SQL type 1111 is "OTHER":

 /**
     * The constant in the Java programming language that indicates
     * that the SQL type is database-specific and
     * gets mapped to a Java object that can be accessed via
     * the methods <code>getObject</code> and <code>setObject</code>.
     */
        public final static int OTHER           = 1111;

So I'm not sure how NiFi could know what to do here because it could be anything depending on the type of DB.


推荐阅读