Skip to content

Commit

Permalink
Merge pull request #1932 from gianm/data-schema-exclude-metric-names
Browse files Browse the repository at this point in the history
DataSchema: Exclude metric names from dimension list.
  • Loading branch information
fjy committed Nov 7, 2015
2 parents 61139b9 + 6b908a5 commit fe6efb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public InputRowParser getParser()
final Set<String> dimensionExclusions = Sets.newHashSet();
for (AggregatorFactory aggregator : aggregators) {
dimensionExclusions.addAll(aggregator.requiredFields());
dimensionExclusions.add(aggregator.getName());
}

if (inputRowParser.getParseSpec() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void testDefaultExclusions() throws Exception
);

Assert.assertEquals(
ImmutableSet.of("time", "col1", "col2"),
ImmutableSet.of("time", "col1", "col2", "metric1", "metric2"),
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
);
}
Expand Down Expand Up @@ -101,7 +101,7 @@ public void testExplicitInclude() throws Exception
);

Assert.assertEquals(
ImmutableSet.of("dimC", "col1"),
ImmutableSet.of("dimC", "col1", "metric1", "metric2"),
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
);
}
Expand Down

0 comments on commit fe6efb6

Please sign in to comment.