Query Execution for Lookups

Hi All,

I have a question about query executions for lookups.

It looks like for lookups, druid will do aggregation first and then perform looks only when the lookup is marked injective (one-to one mapping). Is there a reason why this can’t be done for a many to one mapping (many keys to one value). Just wondering why all the lookups can’t happen after aggregation (I’m probably missing something).


If the results set doesn’t include the key… I think I understand the reason, but if the result set includes the key, can’t the look up still happen post aggregation?

Metric | key
1 | a          
2 | b
3 | c

key | look up
a | bill
b | bill
c | bob

Result with key
1 | a | bill
2 | b | bill
3 | c | bob

Result without key
3 | bill
3 | bob
Maybe I'm missing something or maybe my example is wrong?