Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.14.0
-
None
-
None
Description
The following output is clearly wrong:
baddistinct.sql
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)
I'm guessing it is distinct-ing against the complete value tuple rather than the selected column, since the following is correct:
gooddistinct.sql
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)