NIFI-5727: Added replace unnecessary row count with -1 stub value when paging is used

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #3094
This commit is contained in:
rednikotin 2018-10-19 14:22:33 +03:00 committed by Matthew Burgess
parent e45584d0fb
commit c8928ce350
1 changed files with 7 additions and 1 deletions

View File

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