From 6c648624e82c41d2b6880cfb41dc14a5dd1c06bf Mon Sep 17 00:00:00 2001 From: Monica Pardeshi Date: Fri, 25 Aug 2017 16:53:55 -0500 Subject: [PATCH] Rename filter variables and methods in DataApiRequest (#507) --- CHANGELOG.md | 7 ++ .../webservice/data/DruidQueryBuilder.java | 6 +- .../table/resolver/DataSourceConstraint.java | 2 +- .../bard/webservice/web/DataApiRequest.java | 92 ++++++++++++------- .../webservice/web/endpoints/DataServlet.java | 4 +- .../data/DruidQueryBuilderSpec.groovy | 4 +- ...DimensionToDefaultDimensionSpecSpec.groovy | 2 +- .../LookupDimensionToDimensionSpecSpec.groovy | 2 +- ...dLookupDimensionToDimensionSpecSpec.groovy | 2 +- .../DefaultPhysicalTableResolverSpec.groovy | 2 +- .../QueryPlanningConstraintSpec.groovy | 2 +- .../SchemaPhysicalTableMatcherSpec.groovy | 2 +- .../PartialDataRequestHandlerSpec.groovy | 2 +- .../RoleDimensionApiFilterRequestMapper.java | 2 +- 14 files changed, 81 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aecf14b95..3c0fa68446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,10 @@ Current ### Changed: + +- [Rename filter variables and methods in DataApiRequest](https://github.com/yahoo/fili/pull/507) + * The method names `getFilter` and `getFilters` can be confusing, as well as the `filters` variable + - [Decoupled from static dimension lookup building]() * Instead of `ModelUtils`, create an interface for `ExtractionFunctionDimension` and rebase `LookupDimension` and `RegisteredLookupDimension` on that interface. * `LookupDimensionToDimensionSpec` now uses only the Extraction interface to decide how to serialize dimensions. @@ -87,6 +91,9 @@ Current ### Deprecated: +- [Rename filter variables and methods in DataApiRequest](https://github.com/yahoo/fili/pull/507) + * Deprecated `getFilters` in favor of `getApiFilters` and `getFilter` in favor of `getDruidFilter` + - [Add dimension dictionary to metric loader](https://github.com/yahoo/fili/pull/317) * Deprecated single argument version of `loadMetricDictionary` in `MetricLoader`, favor additional dimension dictionary argument `loadMetricDictionary` instead diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/data/DruidQueryBuilder.java b/fili-core/src/main/java/com/yahoo/bard/webservice/data/DruidQueryBuilder.java index 9754f44afc..607ca95b05 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/data/DruidQueryBuilder.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/data/DruidQueryBuilder.java @@ -126,7 +126,7 @@ public DruidAggregationQuery buildQuery( request.getGranularity(), request.getTimeZone(), request.getDimensions(), - request.getFilter(), + request.getDruidFilter(), request.getIntervals(), druidTopNMetric, request.getTopN().getAsInt() @@ -137,7 +137,7 @@ public DruidAggregationQuery buildQuery( table, request.getGranularity(), request.getTimeZone(), - request.getFilter(), + request.getDruidFilter(), request.getIntervals() ) : buildGroupByQuery( @@ -146,7 +146,7 @@ public DruidAggregationQuery buildQuery( request.getGranularity(), request.getTimeZone(), request.getDimensions(), - request.getFilter(), + request.getDruidFilter(), request.getHaving(), request.getIntervals(), druidOrderBy diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/table/resolver/DataSourceConstraint.java b/fili-core/src/main/java/com/yahoo/bard/webservice/table/resolver/DataSourceConstraint.java index d7a7789a20..690c8aa14e 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/table/resolver/DataSourceConstraint.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/table/resolver/DataSourceConstraint.java @@ -44,7 +44,7 @@ public DataSourceConstraint(DataApiRequest dataApiRequest, DruidAggregationQuery this.filterDimensions = Collections.unmodifiableSet(dataApiRequest.getFilterDimensions()); this.metricDimensions = Collections.unmodifiableSet(templateDruidQuery.getMetricDimensions()); this.metricNames = Collections.unmodifiableSet(templateDruidQuery.getDependentFieldNames()); - this.apiFilters = Collections.unmodifiableMap(dataApiRequest.getFilters()); + this.apiFilters = Collections.unmodifiableMap(dataApiRequest.getApiFilters()); this.allDimensions = Collections.unmodifiableSet(Stream.of( getRequestDimensions().stream(), getFilterDimensions().stream(), diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/web/DataApiRequest.java b/fili-core/src/main/java/com/yahoo/bard/webservice/web/DataApiRequest.java index aeb81eddf9..fb68114bb6 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/web/DataApiRequest.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/web/DataApiRequest.java @@ -91,7 +91,7 @@ public class DataApiRequest extends ApiRequest { private final LinkedHashMap> perDimensionFields; private final Set logicalMetrics; private final Set intervals; - private final Map> filters; + private final Map> apiFilters; private final Map> havings; private final Having having; private final LinkedHashSet sorts; @@ -114,7 +114,7 @@ public class DataApiRequest extends ApiRequest { *
{@code single metric or multiple logical metrics separated by ',' }
* @param intervals URL intervals query string in the format: *
{@code single interval in ISO 8601 format, multiple values separated by ',' }
- * @param filters URL filter query String in the format: + * @param apiFilters URL filter query String in the format: *
{@code
      * ((field name and operation):((multiple values bounded by [])or(single value))))(followed by , or end of string)
      * }
@@ -156,7 +156,7 @@ public DataApiRequest( List dimensions, String logicalMetrics, String intervals, - String filters, + String apiFilters, String havings, String sorts, String count, @@ -210,8 +210,8 @@ public DataApiRequest( this.perDimensionFields = generateDimensionFields(dimensions, dimensionDictionary); // Zero or more filtering dimensions may be referenced - this.filters = generateFilters(filters, table, dimensionDictionary); - validateRequestDimensions(this.filters.keySet(), this.table); + this.apiFilters = generateFilters(apiFilters, table, dimensionDictionary); + validateRequestDimensions(this.apiFilters.keySet(), this.table); // Zero or more having queries may be referenced this.havings = generateHavings(havings, this.logicalMetrics, metricDictionary); @@ -269,7 +269,7 @@ public DataApiRequest( this.table.getName(), this.dimensions, this.perDimensionFields, - this.filters, + this.apiFilters, this.havings, this.logicalMetrics, this.sorts, @@ -280,7 +280,7 @@ public DataApiRequest( this.paginationParameters ); - validateAggregatability(this.dimensions, this.filters); + validateAggregatability(this.dimensions, this.apiFilters); validateTimeAlignment(this.granularity, this.intervals); } @@ -369,7 +369,7 @@ protected DataApiRequest() { this.logicalMetrics = null; this.intervals = null; this.filterBuilder = new DefaultDruidFilterBuilder(); - this.filters = null; + this.apiFilters = null; this.havings = null; this.having = null; this.sorts = null; @@ -391,7 +391,7 @@ protected DataApiRequest() { * @param perDimensionFields Fields for each of the grouped dimensions * @param logicalMetrics Metrics requested * @param intervals Intervals requested - * @param filters Global filters + * @param apiFilters Global filters * @param havings Top-level Having caluses for the request * @param having Single global Druid Having * @param sorts Sorting info for the request @@ -413,7 +413,7 @@ private DataApiRequest( LinkedHashMap> perDimensionFields, Set logicalMetrics, Set intervals, - Map> filters, + Map> apiFilters, Map> havings, Having having, LinkedHashSet sorts, @@ -431,7 +431,7 @@ private DataApiRequest( this.perDimensionFields = perDimensionFields; this.logicalMetrics = logicalMetrics; this.intervals = intervals; - this.filters = filters; + this.apiFilters = apiFilters; this.havings = havings; this.having = having; this.sorts = sorts; @@ -899,43 +899,43 @@ protected int generateInteger(String value, String parameterName) throws BadApiR // CHECKSTYLE:OFF public DataApiRequest withFormat(ResponseFormatType format) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withPaginationParameters(Optional paginationParameters) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withUriInfo(UriInfo uriInfo) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withBuilder(Response.ResponseBuilder builder) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withTable(LogicalTable table) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withGranularity(Granularity granularity) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withDimensions(Set dimensions) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withPerDimensionFields(LinkedHashMap> perDimensionFields) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withLogicalMetrics(Set logicalMetrics) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withIntervals(Set intervals) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withFilters(Map> filters) { @@ -943,35 +943,35 @@ public DataApiRequest withFilters(Map> filters) { } public DataApiRequest withHavings(Map> havings) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withHaving(Having having) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withSorts(LinkedHashSet sorts) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withCount(int count) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withTopN(int topN) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withAsyncAfter(long asyncAfter) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withTimeZone(DateTimeZone timeZone) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } public DataApiRequest withFilterBuilder(DruidFilterBuilder filterBuilder) { - return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, filters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); + return new DataApiRequest(format, paginationParameters, uriInfo, builder, table, granularity, dimensions, perDimensionFields, logicalMetrics, intervals, apiFilters, havings, having, sorts, count, topN, asyncAfter, timeZone, filterBuilder, dateTimeSort); } // CHECKSTYLE:ON @@ -982,7 +982,7 @@ public DataApiRequest withFilterBuilder(DruidFilterBuilder filterBuilder) { * @return Set of filter dimensions. */ public Set getFilterDimensions() { - return filters.keySet(); + return apiFilters.keySet(); } public LogicalTable getTable() { @@ -1009,8 +1009,20 @@ public Set getIntervals() { return this.intervals; } + public Map> getApiFilters() { + return this.apiFilters; + } + + /** + * Returns this request's Api filters. + * + * @return a Map of Dimensions to the set of Api Filters + * + * @deprecated this method has been deprecated because its name is unclear. Please use {@link #getApiFilters()}. + */ + @Deprecated public Map> getFilters() { - return this.filters; + return getApiFilters(); } /** @@ -1020,15 +1032,29 @@ public Map> getFilters() { * * @return the Druid filter */ - public Filter getFilter() { + public Filter getDruidFilter() { try (TimedPhase timer = RequestLog.startTiming("BuildingDruidFilter")) { - return filterBuilder.buildFilters(this.filters); + return filterBuilder.buildFilters(this.apiFilters); } catch (DimensionRowNotFoundException e) { LOG.debug(e.getMessage()); throw new BadApiRequestException(e); } } + /** + * Builds and returns the Druid filters from this request's {@link ApiFilter}s. + *

+ * The Druid filters are built (an expensive operation) every time this method is called. Use it judiciously. + * + * @return the Druid filter + * + * @deprecated this method has been deprecated because its name is unclear. Please use {@link #getDruidFilter()}. + */ + @Deprecated + public Filter getFilter() { + return getDruidFilter(); + } + public Map> getHavings() { return this.havings; } diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/DataServlet.java b/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/DataServlet.java index 00716f5178..d68642efea 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/DataServlet.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/DataServlet.java @@ -220,7 +220,7 @@ private void logRequestMetrics(DataApiRequest request, Boolean readCache, DruidQ new DataRequest( table, request.getIntervals(), - request.getFilters().values(), + request.getApiFilters().values(), metrics, dimensions, druidQuery.getDataSource().getNames(), @@ -419,7 +419,7 @@ public void getData( try (TimedPhase timer = RequestLog.startTiming("logRequestMetrics")) { logRequestMetrics(apiRequest, readCache, druidQuery); - RequestLog.record(new DruidFilterInfo(apiRequest.getFilter())); + RequestLog.record(new DruidFilterInfo(apiRequest.getDruidFilter())); } // Process the request diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/data/DruidQueryBuilderSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/data/DruidQueryBuilderSpec.groovy index 6644d38f3d..630b3f18ac 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/data/DruidQueryBuilderSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/data/DruidQueryBuilderSpec.groovy @@ -31,8 +31,6 @@ import com.yahoo.bard.webservice.druid.model.query.TopNQuery import com.yahoo.bard.webservice.metadata.DataSourceMetadataService import com.yahoo.bard.webservice.table.ConstrainedTable import com.yahoo.bard.webservice.table.TableTestUtils -import com.yahoo.bard.webservice.table.StrictPhysicalTable -import com.yahoo.bard.webservice.table.PhysicalTable import com.yahoo.bard.webservice.table.resolver.DefaultPhysicalTableResolver import com.yahoo.bard.webservice.web.ApiFilter import com.yahoo.bard.webservice.web.ApiHaving @@ -121,7 +119,7 @@ class DruidQueryBuilderSpec extends Specification { apiRequest.getGranularity() >> HOUR.buildZonedTimeGrain(UTC) apiRequest.getTimeZone() >> UTC apiRequest.getDimensions() >> ([resources.d1] as Set) - apiRequest.getFilters() >> apiFilters + apiRequest.getApiFilters() >> apiFilters apiRequest.getLogicalMetrics() >> ([lm1] as Set) apiRequest.getIntervals() >> intervals apiRequest.getFilterDimensions() >> [] diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/DimensionToDefaultDimensionSpecSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/DimensionToDefaultDimensionSpecSpec.groovy index 0e0f0b18a6..769ab90886 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/DimensionToDefaultDimensionSpecSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/DimensionToDefaultDimensionSpecSpec.groovy @@ -52,7 +52,7 @@ class DimensionToDefaultDimensionSpecSpec extends Specification { apiRequest.getTopN() >> OptionalInt.empty() apiRequest.getSorts() >> ([]) apiRequest.getCount() >> OptionalInt.empty() - apiRequest.getFilters() >> Collections.emptyMap() + apiRequest.getApiFilters() >> Collections.emptyMap() } def "Serialize to apiName when apiName and physicalName of a dimension is the same"() { diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/LookupDimensionToDimensionSpecSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/LookupDimensionToDimensionSpecSpec.groovy index 4c868d8bd6..6ab044d26f 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/LookupDimensionToDimensionSpecSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/LookupDimensionToDimensionSpecSpec.groovy @@ -53,7 +53,7 @@ class LookupDimensionToDimensionSpecSpec extends Specification{ apiRequest.getTopN() >> OptionalInt.empty() apiRequest.getSorts() >> ([]) apiRequest.getCount() >> OptionalInt.empty() - apiRequest.getFilters() >> Collections.emptyMap() + apiRequest.getApiFilters() >> Collections.emptyMap() } def "Given lookup dimension with no namespace serialize using dimension serializer"() { diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/RegisteredLookupDimensionToDimensionSpecSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/RegisteredLookupDimensionToDimensionSpecSpec.groovy index ab6a51b439..627e51d646 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/RegisteredLookupDimensionToDimensionSpecSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/druid/serializers/RegisteredLookupDimensionToDimensionSpecSpec.groovy @@ -53,7 +53,7 @@ class RegisteredLookupDimensionToDimensionSpecSpec extends Specification{ apiRequest.getTopN() >> OptionalInt.empty() apiRequest.getSorts() >> ([]) apiRequest.getCount() >> OptionalInt.empty() - apiRequest.getFilters() >> Collections.emptyMap() + apiRequest.getApiFilters() >> Collections.emptyMap() } def "Given registered lookup dimension with no lookup serialize using dimension serializer"() { diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/DefaultPhysicalTableResolverSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/DefaultPhysicalTableResolverSpec.groovy index 322e6e0c7c..4a209bab57 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/DefaultPhysicalTableResolverSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/DefaultPhysicalTableResolverSpec.groovy @@ -138,7 +138,7 @@ class DefaultPhysicalTableResolverSpec extends Specification { apiRequest.granularity >> granularity apiRequest.filterDimensions >> prototype['filterDimensions'] apiRequest.logicalMetrics >> prototype['logicalMetrics'] - apiRequest.getFilters() >> Collections.emptyMap() + apiRequest.getApiFilters() >> Collections.emptyMap() return apiRequest } diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/QueryPlanningConstraintSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/QueryPlanningConstraintSpec.groovy index 88045e70dc..fb2995eba2 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/QueryPlanningConstraintSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/QueryPlanningConstraintSpec.groovy @@ -13,7 +13,7 @@ class QueryPlanningConstraintSpec extends Specification { DataApiRequest dataApiRequest = Mock(DataApiRequest) dataApiRequest.getDimensions() >> ([] as Set) dataApiRequest.getFilterDimensions() >> ([] as Set) - dataApiRequest.getFilters() >> [:] + dataApiRequest.getApiFilters() >> [:] dataApiRequest.getIntervals() >> ([] as Set) dataApiRequest.getLogicalMetrics() >> ([] as Set) dataApiRequest.getGranularity() >> (DefaultTimeGrain.DAY) diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/SchemaPhysicalTableMatcherSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/SchemaPhysicalTableMatcherSpec.groovy index bd2766c8c6..11f090c782 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/SchemaPhysicalTableMatcherSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/table/resolver/SchemaPhysicalTableMatcherSpec.groovy @@ -80,7 +80,7 @@ class SchemaPhysicalTableMatcherSpec extends Specification { query.getDependentFieldNames() >> ([] as Set) request.getFilterDimensions() >> [] request.getDimensions() >> (dimSet) - request.getFilters() >> Collections.emptyMap() + request.getApiFilters() >> Collections.emptyMap() request.getIntervals() >> [] request.getLogicalMetrics() >> [] diff --git a/fili-core/src/test/groovy/com/yahoo/bard/webservice/web/handlers/PartialDataRequestHandlerSpec.groovy b/fili-core/src/test/groovy/com/yahoo/bard/webservice/web/handlers/PartialDataRequestHandlerSpec.groovy index 138e1c96df..e350b61a88 100644 --- a/fili-core/src/test/groovy/com/yahoo/bard/webservice/web/handlers/PartialDataRequestHandlerSpec.groovy +++ b/fili-core/src/test/groovy/com/yahoo/bard/webservice/web/handlers/PartialDataRequestHandlerSpec.groovy @@ -53,7 +53,7 @@ class PartialDataRequestHandlerSpec extends Specification { physicalTable.getAvailableIntervals() >> availableIntervals apiRequest.getDimensions() >> Collections.emptySet() apiRequest.getFilterDimensions() >> Collections.emptySet() - apiRequest.getFilters() >> Collections.emptyMap() + apiRequest.getApiFilters() >> Collections.emptyMap() apiRequest.getGranularity() >> DefaultTimeGrain.DAY groupByQuery.getMetricDimensions() >> Collections.emptySet() groupByQuery.getDependentFieldNames() >> Collections.emptySet() diff --git a/fili-security/src/main/java/com/yahoo/bard/webservice/web/security/RoleDimensionApiFilterRequestMapper.java b/fili-security/src/main/java/com/yahoo/bard/webservice/web/security/RoleDimensionApiFilterRequestMapper.java index bff9c30ad4..1136fa861a 100644 --- a/fili-security/src/main/java/com/yahoo/bard/webservice/web/security/RoleDimensionApiFilterRequestMapper.java +++ b/fili-security/src/main/java/com/yahoo/bard/webservice/web/security/RoleDimensionApiFilterRequestMapper.java @@ -90,7 +90,7 @@ protected DataApiRequest internalApply(DataApiRequest request, ContainerRequestC validateSecurityFilters(securityContext.getUserPrincipal(), securityFilters); - Map> revisedFilters = mergeSecurityFilters(request.getFilters(), securityFilters); + Map> revisedFilters = mergeSecurityFilters(request.getApiFilters(), securityFilters); return request.withFilters(revisedFilters); }