I have a numeric dimension commentLength (it is encoded as a string but all the values are numbers)
see: https://github.com/implydata/datazoo/blob/master/druid/wikipedia-index.json#L29
I want to compute the min and max of it but doing this:
{
"name": "MaxCommentLength",
"type": "doubleMax",
"fieldName": "commentLength"
}
Gives 0.
Instead I have to do this: (I am not even mad because I ❤️ JS)
{
"name": "MaxCommentLength",
"type": "javascript",
"fieldNames": [
"commentLength"
],
"fnAggregate": "function(_c,commentLength) { return Math.max(_c,commentLength); }",
"fnCombine": "function(a,b) { return Math.max(a,b); }",
"fnReset": "function() { return -Infinity; }"
}
Is it possible to have native aggregators auto parse strings as numbers if they are invoked on a dimension?
PS. the motivation for getting the min and max are contentious dimension controls like this:

I have a numeric dimension
commentLength(it is encoded as a string but all the values are numbers)see: https://github.com/implydata/datazoo/blob/master/druid/wikipedia-index.json#L29
I want to compute the min and max of it but doing this:
{ "name": "MaxCommentLength", "type": "doubleMax", "fieldName": "commentLength" }Gives 0.
Instead I have to do this: (I am not even mad because I ❤️ JS)
{ "name": "MaxCommentLength", "type": "javascript", "fieldNames": [ "commentLength" ], "fnAggregate": "function(_c,commentLength) { return Math.max(_c,commentLength); }", "fnCombine": "function(a,b) { return Math.max(a,b); }", "fnReset": "function() { return -Infinity; }" }Is it possible to have native aggregators auto parse strings as numbers if they are invoked on a dimension?
PS. the motivation for getting the min and max are contentious dimension controls like this: