diff --git a/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java b/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java index 84bef1b33a4..6e3386e36af 100644 --- a/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/QueryableIndexStorageAdapter.java @@ -407,7 +407,7 @@ public class QueryableIndexStorageAdapter implements StorageAdapter if (cachedMetricVals == null) { Column holder = index.getColumn(metricName); - if (holder != null && holder.getCapabilities().getType() == ValueType.LONG) { + if (holder != null && (holder.getCapabilities().getType() == ValueType.LONG || holder.getCapabilities().getType() == ValueType.FLOAT)) { cachedMetricVals = holder.getGenericColumn(); genericColumnCache.put(metricName, cachedMetricVals); } @@ -898,7 +898,7 @@ public class QueryableIndexStorageAdapter implements StorageAdapter if (cachedMetricVals == null) { Column holder = index.getColumn(metricName); - if (holder != null && holder.getCapabilities().getType() == ValueType.LONG) { + if (holder != null && (holder.getCapabilities().getType() == ValueType.LONG || holder.getCapabilities().getType() == ValueType.FLOAT)) { cachedMetricVals = holder.getGenericColumn(); genericColumnCache.put(metricName, cachedMetricVals); } diff --git a/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java index 8aa260e4e53..c66fac93d09 100644 --- a/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java +++ b/processing/src/main/java/io/druid/segment/column/IndexedFloatsGenericColumn.java @@ -82,7 +82,7 @@ public class IndexedFloatsGenericColumn implements GenericColumn @Override public long getLongSingleValueRow(int rowNum) { - throw new UnsupportedOperationException(); + return (long) column.get(rowNum); } @Override diff --git a/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java b/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java index 368e7b11ebe..29c599ff08e 100644 --- a/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java +++ b/processing/src/main/java/io/druid/segment/column/IndexedLongsGenericColumn.java @@ -70,7 +70,7 @@ public class IndexedLongsGenericColumn implements GenericColumn @Override public float getFloatSingleValueRow(int rowNum) { - throw new UnsupportedOperationException(); + return (float) column.get(rowNum); } @Override