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

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

Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2039#discussion_r129494131
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java
 ---
    @@ -198,6 +201,25 @@ public void onTrigger(final ProcessContext context, 
final ProcessSessionFactory
                 // set as the current state map (after the session has been 
committed)
                 final Map<String, String> statePropertyMap = new 
HashMap<>(stateMap.toMap());
     
    +            // If an initial max value for column(s) has been specified 
using properties, and this column is not in the state manager, sync them to the 
state property map
    +            final Map<String,String> maxValueProperties = 
getDefaultMaxValueProperties(context.getProperties());
    --- End diff --
    
    Would it make sense to do it in the ``@OnScheduled`` method of the Abstract 
class? You could have the same code in common for QueryDatabaseTable and 
GenerateTableFetch. Besides not sure it needs to be done each time the 
processor is triggered? Thoughts?


> GenerateTableFetch should allow you to specify an initial Max Value
> -------------------------------------------------------------------
>
>                 Key: NIFI-3335
>                 URL: https://issues.apache.org/jira/browse/NIFI-3335
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Matt Burgess
>            Assignee: Matt Burgess
>
> NIFI-2583 added the ability (via dynamic properties) to specify initial Max 
> Values for columns, to enable the user to "pick up where they left off" if 
> something happened with a flow, a NiFi instance, etc. where the state was 
> stored but the processing did not complete successfully.
> This feature would also be helpful in GenerateTableFetch, which also supports 
> max-value columns.
> Since NIFI-2881 adds incoming flow file support, it's more useful if Initial 
> max values can be specified via flow file attributes. Because if a table name 
> is dynamically passed via flow file attribute and Expression Language, user 
> won't be able to configure dynamic processor attribute in advance for each 
> possible table.
> Add dynamic properties ('initial.maxvalue.<max_value_column>' same as 
> QueryDatabaseTable) to specify initial max values statically, and also use 
> incoming flow file attributes named 'initial.maxvalue.<max_value_column>' if 
> any. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to