/** * Builds a set of only those metric columns which correspond to the metrics requested in the API. * * @param apiMetricColumnNames Set of Metric names extracted from the requested api metrics * * @return set of metric columns */ protected LinkedHashSet<MetricColumn> generateApiMetricColumns(Set<String> apiMetricColumnNames) { // Get the metric columns from the schema Map<String, MetricColumn> metricColumnMap = resultSet.getSchema().getColumns(MetricColumn.class).stream() .collect(StreamUtils.toLinkedDictionary(MetricColumn::getName)); // Select only api metrics from resultSet return apiMetricColumnNames.stream() .map(metricColumnMap::get) .collect(Collectors.toCollection(LinkedHashSet::new)); }
throws BadApiRequestException { Map<String, DimensionField> dimensionNameToFieldMap = dimension.getDimensionFields().stream() .collect(StreamUtils.toLinkedDictionary(DimensionField::getName));