cody81314 opened a new issue, #11002:
URL: https://github.com/apache/pinot/issues/11002
Trino version: v419.
Pinot version: v0.12.1
I am using Trino to query Pinot, and I have encountered an issue with the
results when using the `OR` operator in the `WHERE` clause. The specific query
is as follows:
```sql
WITH fd AS (
SELECT user_id, affiliate
FROM (
SELECT user_id, affiliate, row_number() OVER (PARTITION BY user_id ORDER
BY count(0) DESC) AS rn
FROM sensitive_table
GROUP BY user_id, affiliate
) ac
WHERE rn = 1
)
SELECT fd.user_id, s2.account_user_id, fd.affiliate
FROM sensitive_table_2 s2
RIGHT JOIN fd ON fd.user_id = s2.account_user_id
WHERE fd.user_id = 'sensitive_user_id' OR s2.account_user_id =
'sensitive_user_id'
```
When I modify the condition to use the `OR` operator
```sql
WHERE fd.user_id = 'sensitive_user_id' OR s2.account_user_id =
'sensitive_user_id'
```
, the query fails to retrieve any data. However, when I use the `AND
`operator
```sql
WHERE fd.user_id = 'sensitive_user_id' AND s2.account_user_id =
'sensitive_user_id'
```
, the query returns the expected results.
This behavior seems to indicate an issue with the Pinot connector in Trino
when handling `OR `conditions in the `WHERE `clause. The connector might not be
correctly evaluating the `OR `operator in this scenario, leading to incorrect
results.
I kindly request the Trino community to investigate and address this issue
with the Pinot connector, as it hinders the ability to construct queries with
flexible conditions. Thank you for your attention to this matter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]