[
https://issues.apache.org/jira/browse/NIFI-3335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16102025#comment-16102025
]
ASF GitHub Bot commented on NIFI-3335:
--------------------------------------
Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2039#discussion_r129648705
--- 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 --
Yeah that's a better idea, should've been done in the original PR but I
missed it during my review and just cut-pasted it back to the abstract class to
share.
I won't be able to move all that common code block as it needs the table
name which can come from a flow file. But I can call
getDefaultMaxValueProperties() at schedule-time vs trigger time.
> 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)