nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Bende (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (NIFI-2048) ExecuteSQL converts BigDecimal to strings in Avro
Date Tue, 08 Aug 2017 18:41:00 GMT

     [ https://issues.apache.org/jira/browse/NIFI-2048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bryan Bende resolved NIFI-2048.
-------------------------------
       Resolution: Duplicate
    Fix Version/s: 1.3.0

Closing this since it is a duplicate of NIFI-2624.

> ExecuteSQL converts BigDecimal to strings in Avro
> -------------------------------------------------
>
>                 Key: NIFI-2048
>                 URL: https://issues.apache.org/jira/browse/NIFI-2048
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.6.1
>            Reporter: Bryan Bende
>            Priority: Minor
>             Fix For: 1.3.0
>
>
> Some JDBC drivers (Oracle is one of them) return NUMBER columns as BigDecimal. NiFi then
turns that into a string in the Avro that is produced. 
> This happens in JdbcCommon when creating the schema:
> {code}        
> case DECIMAL:
> case NUMERIC:            
> builder.name(meta.getColumnName(i)).type().unionOf()
>   .nullBuilder().endNull().and().stringType().endUnion().noDefault();
> {code}
> Then later when getting the value of the column to add to the Avro record:
> {code}
> } else if (value instanceof BigDecimal || value instanceof BigInteger) {
>                         rec.put(i - 1, value.toString());
>                     } 
> {code}
> It looks like Avro has support for Decimal types and we should look into using this:
> https://avro.apache.org/docs/1.7.7/spec.html#Logical+Types
> https://issues.apache.org/jira/browse/AVRO-1402



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message