Update IncrementalIndex.getMetricType() to return type name stored by ComplexMetricsSerde instead of AggregatorFactory.getTypeName() (#3341)

This commit is contained in:
Himanshu 2016-08-10 13:03:44 -05:00 committed by Fangjin Yang
parent 46da682231
commit 043562914d
1 changed files with 7 additions and 3 deletions

View File

@ -1022,14 +1022,18 @@ public abstract class IncrementalIndex<AggregatorType> implements Iterable<Row>,
{ {
this.index = index; this.index = index;
this.name = factory.getName(); this.name = factory.getName();
this.type = factory.getTypeName();
String typeInfo = factory.getTypeName();
this.capabilities = new ColumnCapabilitiesImpl(); this.capabilities = new ColumnCapabilitiesImpl();
if (type.equalsIgnoreCase("float")) { if (typeInfo.equalsIgnoreCase("float")) {
capabilities.setType(ValueType.FLOAT); capabilities.setType(ValueType.FLOAT);
} else if (type.equalsIgnoreCase("long")) { this.type = typeInfo;
} else if (typeInfo.equalsIgnoreCase("long")) {
capabilities.setType(ValueType.LONG); capabilities.setType(ValueType.LONG);
this.type = typeInfo;
} else { } else {
capabilities.setType(ValueType.COMPLEX); capabilities.setType(ValueType.COMPLEX);
this.type = ComplexMetrics.getSerdeForType(typeInfo).getTypeName();
} }
} }