apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.41k stars 1.27k forks source link

LOOKUP (dimension table) does not work with GROUP BY #11018

Open egalpin opened 1 year ago

egalpin commented 1 year ago

From the broker logs:

2023/06/30 21:28:35.954 ERROR [PinotClientRequest] [jersey-server-managed-async-executor-1] Caught exception while processing POST request
java.lang.IllegalArgumentException: Unsupported function: lookup not found
    at org.apache.pinot.core.query.postaggregation.PostAggregationFunction.<init>(PostAggregationFunction.java:47)

It's called out in the docs that LOOKUP is not supported for multi-value fields. But is it intentionally not supported for post-aggregation decoration? Or is this just an omission?

egalpin commented 1 year ago

It turns out that the root cause of the issue is that the fields being fetched via LOOKUP function were not included in the GROUP BY clause. The above error did not mention this cause at all, so it was not obvious this was the issue. This issue could be closed or replaced with one involving making the error message more clear.

Jackie-Jiang commented 1 year ago

Can you also share the query? In order to do post-aggregation, the function must be registered as scalar function. There is no scalar function version of look_up, thus the exception. I don't think look_up makes sense as scalar function though