Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache Nifi ExecuteSQL -> PutDatabaseRecord flow mishandles Decimal datatype.

Apache Nifi ExecuteSQL -> PutDatabaseRecord flow mishandles Decimal datatype.

New Contributor

Tested simple Nifi flow ExecuteSQL -> PutDatabasRecord

ExecuteSQL reads data from table (named decimal_test) having columns with decimal data type (from Postgres database).

The output flowfile (avro file) from ExecuteSQL passed to PutDatabaseRecord which loads the data to the same table (decimal_test) in the Postgres database.

ExecuteSQL property 'user avro logical types' is set to true.

Here is the result:

Decimal columnOriginal Table values in Postgres databaseTable migrated from Postgres to Postgres using Nifi
decimal(18,0)123456789012345678123456789012346000
decimal(18,4)12345678901234.123412345678901234.1000
decimal(36,0)123456789012345678901234567890123456123456789012346000000000000000000000
decimal(36,4)12345678901234567890123456789012.123412345678901234600000000000000000.0000

Is is a bug in Nifi or am I missing something here..?

Please advice. Thanks.

Don't have an account?
Coming from Hortonworks? Activate your account here