Marc Prud'hommeaux created CALCITE-2002:
-------------------------------------------
Summary: Distinct query against in-memory values is sometimes wrong
Key: CALCITE-2002
URL: https://issues.apache.org/jira/browse/CALCITE-2002
Project: Calcite
Issue Type: Bug
Affects Versions: 1.14.0
Reporter: Marc Prud'hommeaux
Assignee: Julian Hyde
The following output is clearly wrong:
{code:title=baddistinct.sql|borderStyle=solid}
0: jdbc:calcite:model=inline:{"version":1.0,"> SELECT DISTINCT T.B FROM (VALUES
(1, 'X'),(2, 'Y'),(3, 'X'),(4, 'X')) AS T(A, B);
+---+
| B |
+---+
| X |
| Y |
| X |
| X |
+---+
4 rows selected (0.014 seconds)
{code}
I'm guessing it is distinct-ing against the complete value tuple rather than
the selected column, since the following is correct:
{code:title=gooddistinct.sql|borderStyle=solid}
0: jdbc:calcite:model=inline:{"version":1.0,"> SELECT DISTINCT T.B FROM (VALUES
(1, 'X'),(2, 'Y'),(3, 'X'),(3, 'X')) AS T(A, B);
+---+
| B |
+---+
| X |
| Y |
+---+
2 rows selected (0.013 seconds)
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)