You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Koji Kawamura (JIRA)" <ji...@apache.org> on 2018/01/23 06:24:00 UTC

[jira] [Commented] (NIFI-4393) AbstractDatabaseFetchProcessor handles SQL Server brackets incorrectly

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

Koji Kawamura commented on NIFI-4393:
-------------------------------------

Hi [~msiedlarek] [~mattyb149], I came across this issue, but with MySQL in my case. MySQL allows table and column names to be wrapped with back-ticks(`). I was trying to fix it with similar approach that [~msiedlarek] did in the patch. But I agree with what [~mattyb149] suggested. Now I moved the unwrap logic into DatabaseAdapters. Testing with various database engines now (MySQL, PostgreSQL and Microsoft SQL Server). I will send a PR shortly once I finished the test. Thank you!

> AbstractDatabaseFetchProcessor handles SQL Server brackets incorrectly
> ----------------------------------------------------------------------
>
>                 Key: NIFI-4393
>                 URL: https://issues.apache.org/jira/browse/NIFI-4393
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.4.0
>            Reporter: Mikołaj Siedlarek
>            Assignee: Koji Kawamura
>            Priority: Major
>         Attachments: 0001-Handle-SQL-Server-square-brackets-in-AbstractDatabas.patch
>
>
> SQL Server allows column names to contain whitespace, in which case they are written in SQL queries inside square brackets. When using processors based on {{AbstractDatabaseFetchProcessor}}, such as {{QueryDatabaseTable}} they have to be specified in  "Maximum-value Columns" in square brackets, because otherwise they would break a SELECT query. However, when such column name is retrieved from ResultSetMetaData, the driver returns it without square brackets. This causes a mismatch between the key used to save last seen maximum value in processor's state and the one used to search for the value later.
> I'm not sure whether the attached patch is very elegant, but it fixes the issue in a simplest way possible.



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