Aggregation on strings(dimension)
A recent discussion on this topic can be found here: https://groups.google.com/forum/#!topic/druid-user/lZVvnaLjkEA
I have data schema as follow, dimensions are [mac, username, osType] and metric is traffic:
clientMac username osType traffic
00:19:F8:10:00:01 user0 Window 10
00:19:F8:10:00:01 user1 Linux 20
00:19:F8:10:00:02 user2 Android 30
00:19:F8:10:00:03 user3 ios 40
And what I want to do is to group the traffics(return sum), username(return array), osType(return array) by clientMac looks like:
[
{
"version": "v1",
"timestamp": "2015-11-01T00:00:00.000Z",
"event": {
"clientMac": "00:19:F8:10:00:01",
"totalCount": 2,
"username": ["user0", "user1"],
"osType": ["Window", "Linux"],
"traffic": 30
}
},
{
"version": "v1",
"timestamp": "2015-11-01T00:00:00.000Z",
"event": {
"clientMac": "00:19:F8:10:00:02",
"totalCount": 1,
"username": ["user2"],
"osType": ["Android"],
"traffic": 30
}
},
{
"version": "v1",
"timestamp": "2015-11-01T00:00:00.000Z",
"event": {
"clientMac": "00:19:F8:10:00:03",
"totalCount": 1,
"username": ["user3"],
"osType": ["ios"],
"traffic": 40
}
}
]
:+1: we are stuck with this too, would be cool to have a first() aggregator or something, so we can select string fields
A topN set aggregator would be nice too, even lacking counts, to get a representative set of high cardinality dimensions.
Inside Spark this is a function named collect_list can do such stuff: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L201-L225

hi, are you fix this problem?
Any update on this feature? Is there any way we can achieve string aggregation in the latest version of Druid ?
Hi, Any update on this issue? Is this feature going to be available in new version of Druid?
Thanks! Manu
Sadly this won't be in 0.17
Ok. Thanks @jnaous . Is it possible to use lookups as a workaround? Like, use lookups for string columns on aggregation has to be executed with a numeric value as key and actual string as value. Then if an aggregation is executed on that column, will it be executed on the numeric key and the result will be replaced with the actual string?
Interesting :) I'm not sure. You'd have to try it!
Cool. Thanks! I will give it a try
This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.