trino icon indicating copy to clipboard operation
trino copied to clipboard

[Pinot connector] Failing queries when having duplicated aggregation metrics

Open jpohanka opened this issue 2 years ago • 3 comments

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.

jpohanka avatar Jul 25 '22 20:07 jpohanka

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.

elonazoulay avatar Aug 09 '22 01:08 elonazoulay

Soon we will migrate to table functions which should fix this issue, I will verify that and update.

elonazoulay avatar Aug 09 '22 08:08 elonazoulay

@elonazoulay We use Trino 389 and a 'pre-release' of Pinot 0.11.0. Thank you for your help!

jpohanka avatar Aug 09 '22 12:08 jpohanka