Support Questions

Find answers, ask questions, and share your expertise

Postgres composite / user defined types in Apache NiFi

avatar
New Contributor

I have successfully worked with postgres enum in Apache NiFi 1.24 but I can't read or write columns defined as composite types.

I have used standard jdbc postgres driver and also pgjdbc-ng driver but it did not help. I also tried to define my composite type as an avro record inside my row record but I always get the error :

Unable to execute SQL select query SELECT * FROM refugit.payments due to org.apache.nifi.processor.exception.ProcessException: Error during database query or conversion of records.
- Caused by: java.lang.IllegalArgumentException: createSchema: Unknown SQL type 2002 / audit (table: payments, column: audit) cannot be converted to Avro type: {}

My audit column is defined as follows :
CREATE TYPE refugit.audit AS (
version integer,
user_id uuid,
versiondate timestamptz,
userip inet
);


Should I :

- move to NiFi 2.0.0 ?

- write a custom DBCPConnectionPool to define type mapping ?

Any suggestion appreciated !

1 REPLY 1

avatar
Community Manager

@ceco Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @MattWho @SAMSAL  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: