String metrics

We have a data source that is essentially a time-series index into a non-Druid data store. The queries we want are “over a given time interval, filtering on various other dimensions, give me some item ID”.

Right now “item ID” is a dimension, and this does work. But one aspect of our semantics is we really don’t need more than one item ID to be saved in Druid for any given combination of the other dimensions, per minute (and queryGranularity is “minute”).

It seems like what we want is to define our item ID as a metric rather than as a dimension, and use the stringFirst aggregator on this. This seems like it should work. But what confuses me is that it seems like a lot of the code assumes that metrics are numbers — eg, returns Number. So are string metrics actually a thing that works, or not?


Oh heh, maybe the answer is just that Row.getMetric is a convenience method only used in a couple of places :slight_smile: