[
https://issues.apache.org/jira/browse/NIFI-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16206583#comment-16206583
]
Matt Burgess commented on NIFI-4393:
------------------------------------
Since this is DB-specific, I'd prefer to see the patch affect only the
DB-specific code, namely MSSQLDatabaseAdapter and/or MSSQL2008DatabaseAdapter.
Seems like as part of the getSelectStatement() processing, the column names
could be split, bracketed, then added to the statement? Not sure if there would
be changes in other places as well, but that's often where we do that kind of
DB-specific SQL manipulation, rather than in the shared class where things like
removing brackets could impact other DBs.
> 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
> 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
(v6.4.14#64029)