trino
trino copied to clipboard
[Pinot connector] Failing queries when having duplicated aggregation metrics
Trino version: 389
Description:
Let's assume that we have a Pinot table tab
and in this table, we have the following columns:
-
some_quantity
- double-type column
Consider the following query in Pinot:
SELECT
SUM(some_quantity) AS tot_quantity1,
SUM(some_quantity) AS tot_quantity2
FROM
tab
The following is the same Pinot query as a passthrough query in Trino:
SELECT
*
FROM
pinot.default."
SELECT
SUM(some_quantity) AS tot_quantity1,
SUM(some_quantity) AS tot_quantity2
FROM
tab
"
The first query runs successfully and returns the correct results.
The second query fails and throws the following error:
Multiple entries with same key: sum(some_quantity)=io.trino.plugin.pinot.query.DynamicTableBuilder$PinotColumnNameAndTrinoType@66fef16 and sum(some_quantity)=io.trino.plugin.pinot.query.DynamicTableBuilder$PinotColumnNameAndTrinoType@4023dfc1
This happens in the case of simple, as well as complex aggregate expressions.
Which version of trino and pinot are you using? This may be related to another issue but I will have to see if it applies to the versions you are using.
Soon we will migrate to table functions which should fix this issue, I will verify that and update.
@elonazoulay We use Trino 389
and a 'pre-release' of Pinot 0.11.0
. Thank you for your help!