You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/05/03 13:07: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=16462405#comment-16462405 ] 

ASF subversion and git services commented on NIFI-4393:
-------------------------------------------------------

Commit 2007c207ab1fac0c1d030cf29623796997650b20 in nifi's branch refs/heads/master from [~ijokarumawak]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=2007c20 ]

NIFI-4393: Handle database specific identifier escape characters

QueryDatabaseTable and GenerateTableFetch processors were not able to
use max value state as expected, if max value column was wrapped with
escape characters. Due to a mis-match between computed state keys
and actual keys used in the managed state. State keys computed by
getStateKey method included escape characters while actual stored keys
did not. Resulted querying the same dataset again and again.

This commit added unwrapIdentifier method to DatabaseAdapter class to
remove database specific escape characters for identifiers such as table
and column names, so that max value state keys are populated correctly
even if identifiers are wrapped with escape characters.

This commit also added new DatabaseAdapter for MySQL, to handle MySQL
specific identifier escape with back-ticks.

This closes #2424

Signed-off-by: Mike Thomsen <mi...@gmail.com>


> 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)