You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Dorian Bugeja (Jira)" <ji...@apache.org> on 2021/02/20 11:43:00 UTC

[jira] [Commented] (NIFI-8244) PutDatabaseRecord incorrect type resolution for partial columns

    [ https://issues.apache.org/jira/browse/NIFI-8244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287655#comment-17287655 ] 

Dorian Bugeja commented on NIFI-8244:
-------------------------------------

Similar issue

> PutDatabaseRecord incorrect type resolution for partial columns
> ---------------------------------------------------------------
>
>                 Key: NIFI-8244
>                 URL: https://issues.apache.org/jira/browse/NIFI-8244
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.13.0
>            Reporter: Dorian Bugeja
>            Priority: Major
>         Attachments: image-2021-02-20-02-18-10-670.png, image-2021-02-20-02-18-51-952.png, image-2021-02-20-02-26-24-986.png, includedColumns_uses_tableSchema_index.patch
>
>
> Record schema type resolution for PutDatabaseRecord is being performed using fieldIndexes computed in generateInsert/Update/Delete. Problem is that when not all keys in the records are defined or the sequence of the keys in the record does not match the sequence of the column name of the table, includedColumns, which is being populated with the index of the currentRecord (JSON for example) rather than the index of the table schema, will result in incorrect type resolution. Meaning that in the following example, `count` will be converted to String, as the second column in table is a String (Performing UPDATE in PutDatabaseRecord with Update key set to id)
> Table definition = 
> id INT,
>  title VARCHAR,
>  count INT
> Record Update
> {"id": 1, "count": 10}
> !image-2021-02-20-02-18-51-952.png!
> !image-2021-02-20-02-18-10-670.png!
> !image-2021-02-20-02-26-24-986.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)