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

ASF GitHub Bot commented on NIFI-4393:
--------------------------------------

Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/2424
  
    @mattyb149 Thanks for your suggestion. I considered that path, too. But I 
did it this way as it seems simpler to the objective to address the issue. 
However, I think your comment is a good point. And I prefer having wrap method 
in DatabaseAdapters instead of unwrap.
    
    Let's discuss a bit more. I noticed that table and column names are spilled 
into few places. I think we should define how we want those to be set.
    
    - Processor properties:
        - Columns to Return
        - Maximum Value Columns
        - Additional WHERE clause
        - Custom SQL (to be added by #2162)
        - Additional WHERE clause and Custom SQL might be challenging to wrap 
problematic identifies by Processor automatically.
    - Processor State: Stored with a key in `{tableName}!@!{columnName}` 
format. Do we want to keep database specific characters here?
    - Output FlowFile Attributes:
        - max.{columnName} = {maxValue}
        - tableName = {tableName]
        - Do we want to keep database specific characters here?
    
    Even if we change DatabaseAdapter method from unwrap to wrap, it's still 
possible to use wrap character to unwrap. But we need to make a consensus on 
how above listed variables are written.


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

Reply via email to