From aa71a9efbe3a839c5339d04271912121fc9dc8a0 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Fri, 25 Feb 2022 09:01:44 +0100 Subject: [PATCH] [WIP] PARAM_MAX_ROWS_FOR_FACET_GENERATION --- .../src/main/java/li/strolch/report/ReportConstants.java | 2 +- .../java/li/strolch/report/policy/GenericReport.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/li.strolch.service/src/main/java/li/strolch/report/ReportConstants.java b/li.strolch.service/src/main/java/li/strolch/report/ReportConstants.java index a665067f7..910691c7a 100644 --- a/li.strolch.service/src/main/java/li/strolch/report/ReportConstants.java +++ b/li.strolch.service/src/main/java/li/strolch/report/ReportConstants.java @@ -20,7 +20,7 @@ public class ReportConstants { public static final String PARAM_FIELD_REF2 = "fieldRef2"; public static final String PARAM_ALLOW_MISSING_COLUMNS = "allowMissingColumns"; public static final String PARAM_FILTER_MISSING_VALUES_AS_TRUE = "filterMissingValuesAsTrue"; - public static final String PARAM_TRIM_FACETS_VALUES = "trimFacetValues"; + public static final String PARAM_MAX_ROWS_FOR_FACET_GENERATION = "maxRowsForFacetGeneration"; public static final String PARAM_POLICY = "policy"; public static final String PARAM_JOIN_PARAM = "joinParam"; diff --git a/li.strolch.service/src/main/java/li/strolch/report/policy/GenericReport.java b/li.strolch.service/src/main/java/li/strolch/report/policy/GenericReport.java index 2d9111637..da5d54d77 100644 --- a/li.strolch.service/src/main/java/li/strolch/report/policy/GenericReport.java +++ b/li.strolch.service/src/main/java/li/strolch/report/policy/GenericReport.java @@ -540,7 +540,8 @@ public class GenericReport extends ReportPolicy { .sorted(comparing(StringParameter::getIndex)) // .map(StringParameter::getUom).collect(toList()); - boolean trimFacetValues = this.reportRes.getBoolean(PARAM_TRIM_FACETS_VALUES); + boolean maxRowsForFacetGeneration = this.reportRes.getBoolean(PARAM_MAX_ROWS_FOR_FACET_GENERATION); + long count = 0; while (iter.hasNext()) { Map row = iter.next(); @@ -554,7 +555,11 @@ public class GenericReport extends ReportPolicy { } // stop if we have enough data - if (trimFacetValues && result.stream().mapToInt(e -> e.getValue().size()).allMatch(v -> v >= limit)) + count++; +// if (trimFacetValues) { +// +// } + if (result.stream().mapToInt(e -> e.getValue().size()).allMatch(v -> v >= limit)) break; }