mirror of https://github.com/apache/druid.git
Merge pull request #1932 from gianm/data-schema-exclude-metric-names
DataSchema: Exclude metric names from dimension list.
This commit is contained in:
commit
fe6efb6367
|
@ -101,6 +101,7 @@ public class DataSchema
|
||||||
final Set<String> dimensionExclusions = Sets.newHashSet();
|
final Set<String> dimensionExclusions = Sets.newHashSet();
|
||||||
for (AggregatorFactory aggregator : aggregators) {
|
for (AggregatorFactory aggregator : aggregators) {
|
||||||
dimensionExclusions.addAll(aggregator.requiredFields());
|
dimensionExclusions.addAll(aggregator.requiredFields());
|
||||||
|
dimensionExclusions.add(aggregator.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputRowParser.getParseSpec() != null) {
|
if (inputRowParser.getParseSpec() != null) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class DataSchemaTest
|
||||||
);
|
);
|
||||||
|
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
ImmutableSet.of("time", "col1", "col2"),
|
ImmutableSet.of("time", "col1", "col2", "metric1", "metric2"),
|
||||||
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
|
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public class DataSchemaTest
|
||||||
);
|
);
|
||||||
|
|
||||||
Assert.assertEquals(
|
Assert.assertEquals(
|
||||||
ImmutableSet.of("dimC", "col1"),
|
ImmutableSet.of("dimC", "col1", "metric1", "metric2"),
|
||||||
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
|
schema.getParser().getParseSpec().getDimensionsSpec().getDimensionExclusions()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue