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

Peter Wicks updated NIFI-5723:
------------------------------
    Comment: was deleted

(was: If memory serves, this was because Avro does not support underscore's in 
field names. So if you have underscore's in your field names then the export of 
your data in the Avro format would also fail.

By allowing you to replace underscores it gives users a way to extract the 
data.  In NiFi 1.8 you should see some new processors for working with SQL that 
allow you to export the data using Record Writers, giving you more control over 
this process. But if you use Avro, this is still necessary.)

> PutDatabaseRecord strips underbar character from column names
> -------------------------------------------------------------
>
>                 Key: NIFI-5723
>                 URL: https://issues.apache.org/jira/browse/NIFI-5723
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core UI
>    Affects Versions: 1.7.1
>         Environment: Red Hat Enterprise Linux Server release 7.5 (Maipo). 
> Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz 16 cores. 32 Gb RAM. OpenJDK 
> Runtime Environment (build 1.8.0_181-b13)
>            Reporter: Uwe Geercken
>            Priority: Major
>
> In *PutDatabaseRecord.java* there is following code:
> private static String normalizeColumnName(final String colName, final boolean 
> translateColumnNames) {
>        return colName == null ? null : (translateColumnNames ? 
> colName.toUpperCase().replace("_", "") : colName);
> }
> If translateColumnNames is set to true, then the underbar character is 
> stripped from the column names.
> And it is also here:
> final ColumnDescription desc = 
> tableSchema.getColumns().get(normalizeColumnName(fieldName, 
> settings.translateFieldNames));
>                if (desc == null && !settings.ignoreUnmappedFields) {
>                    throw new SQLDataException("Cannot map field '" + 
> fieldName + "' to any column in the database");
> }
> I do not see a reason why this is done. An underbar is a common delimiter in 
> database column names.
> Specifically, I have data comming from an Oracle database which is all 
> uppercase and with the underbar character as the delimiter in the column 
> names and due to the current code, I can not update my MySQL database using 
> the same column names.
> Trying to solve the issue in other ways does not really work as well.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to