Repository: nifi Updated Branches: refs/heads/master e45584d0f -> c8928ce35
NIFI-5727: Added replace unnecessary row count with -1 stub value when paging is used Signed-off-by: Matthew Burgess <[email protected]> This closes #3094 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/c8928ce3 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/c8928ce3 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/c8928ce3 Branch: refs/heads/master Commit: c8928ce3509facbf4b6501295273849de2288fab Parents: e45584d Author: rednikotin <[email protected]> Authored: Fri Oct 19 14:22:33 2018 +0300 Committer: Matthew Burgess <[email protected]> Committed: Tue Oct 23 14:46:14 2018 -0400 ---------------------------------------------------------------------- .../apache/nifi/processors/standard/GenerateTableFetch.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/c8928ce3/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java index dd001a6..49779e9 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java @@ -290,7 +290,13 @@ public class GenerateTableFetch extends AbstractDatabaseFetchProcessor { String columnsClause = null; List<String> maxValueSelectColumns = new ArrayList<>(numMaxValueColumns + 1); - maxValueSelectColumns.add("COUNT(*)"); + + // replace unnecessary row count with -1 stub value when paging is used + if (useColumnValsForPaging) { + maxValueSelectColumns.add("-1"); + } else { + maxValueSelectColumns.add("COUNT(*)"); + } // For each maximum-value column, get a WHERE filter and a MAX(column) alias IntStream.range(0, numMaxValueColumns).forEach((index) -> {
