Github user patricker commented on a diff in the pull request:
https://github.com/apache/nifi/pull/928#discussion_r76466230
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java
---
@@ -258,6 +260,11 @@ public void onTrigger(final ProcessContext context,
final ProcessSessionFactory
fileToProcess =
session.putAttribute(fileToProcess, "fragment.index",
String.valueOf(fragmentIndex));
}
+ // Add maximum values as attributes
+ for (Map.Entry<String, String> entry :
statePropertyMap.entrySet()) {
+ fileToProcess =
session.putAttribute(fileToProcess, "maxvalue." + entry.getKey(),
entry.getValue());
--- End diff --
Hey Matt,
I had been thinking of implementing this same feature, and I have a concern
with how it works. I added a property to control the maximum number of rows
per FlowFile `MAX_ROWS_PER_FLOW_FILE`. If this is enabled and multiple files
are returned then the maxvalue reported on each FlowFile will be different.
I think that is fine, since it would be the max value in that file, except
it might not be... this is because `getQuery` does not sort by the Max Value
Columns, so there is no guaranteed order to the rows. Meaning the value
associated might not be max at all, just the max seen so far across all files.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---