[ https://issues.apache.org/jira/browse/CALCITE-2002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde resolved CALCITE-2002. ---------------------------------- Resolution: Fixed Fix Version/s: 1.16.0 Fixed in [fb070368|http://git-wip-us.apache.org/repos/asf/calcite/commit/fb070368]; thanks for the PR, [~zhenw]! > DISTINCT applied to VALUES returns wrong result > ----------------------------------------------- > > 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 > Priority: Major > Fix For: 1.16.0 > > > 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 (v7.6.3#76005)