return size = 0 in ColumnAnalysis if its unknown

that is if complex agg did not implement inputSizeFn() so
that segment metadata query shows atleast some information.
also instead of COMPLEX, return type of data stored.
This commit is contained in:
Himanshu Gupta 2015-05-14 21:35:49 -05:00
parent 3c3db7229c
commit 2fd3e9e8e5
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ The format of the result is:
```
Dimension columns will have type `STRING`.
Metric columns will have type `FLOAT`.
Metric columns will have type `FLOAT` or `LONG` or name of the underlying complex type such as `hyperUnique` in case of COMPLEX metric.
Timestamp column will have type `LONG`.
Only columns which are dimensions (ie, have type `STRING`) will have any cardinality. Rest of the columns (timestamp and metric columns) will show cardinality as `null`.

View File

@ -143,7 +143,7 @@ public class SegmentAnalyzer
final Function<Object, Long> inputSizeFn = serde.inputSizeFn();
if (inputSizeFn == null) {
return ColumnAnalysis.error("noSizeFn");
return new ColumnAnalysis(typeName, 0, null, null);
}
final int length = column.getLength();
@ -152,6 +152,6 @@ public class SegmentAnalyzer
size += inputSizeFn.apply(complexColumn.getRowValue(i));
}
return new ColumnAnalysis(capabilities.getType().name(), size, null, null);
return new ColumnAnalysis(typeName, size, null, null);
}
}