I just found a nice/weird/strange/unexpected side ...
# general
h
I just found a nice/weird/strange/unexpected side effect which actually gives me intended behavior, but looks so hacky :
Copy code
{
  "type": "extraction",
  "dimension": "dim",
  "outputName": "display_dim",
  "extractionFn": {
    "type": "cascade",
    "extractionFns": [
      {
        "type": "registeredLookup",
        "lookup": "dim_display"
      }
    ]
  }
}
if you do a
topN
it will group them on the lookup key. However:
Copy code
{
  "type": "extraction",
  "dimension": "dim",
  "outputName": "display_dim",
  "extractionFn": {
    "type": "cascade",
    "extractionFns": [
      {
        "type": "registeredLookup",
        "lookup": "dim_display"
      },
      {
        "type": "javascript",
        "function": "function(value) { return value; }"
      }
    ]
  }
}
will actually group by the lookup value i.e. merge rows as long as the lookup values are the same, which is intended in my use case. Is there any cleaner way to get this behavior, because leaving it like this needs a lot of comments to make the next dev understand, why it looks this way.
b
Is
"injective":true
in the lookup definition? If so, this seems like the intended behavior, as the values will only materialize after aggregation. However, if injective is false, then I wouldn't expect that behavior.
h
I didn’t know about this property, but our lookup generator supports it and yep, it’s misconfigured. tnx
👍 1