Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static boolean isDistinctFrom(
if (left.isNull(leftPosition)) {
return false;
}
return left.compareTo(leftPosition, 0, UUID.getFixedSize(), right, rightPosition, 0, UUID.getFixedSize()) != 0;
return !UUID.equalTo(left, leftPosition, right, rightPosition);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,14 @@ public void testMixedDistinctWithFilter()
"FROM (VALUES (1, 3), (2, 4), (2, 4), (4, 5)) t (x, y)",
"VALUES (BIGINT '0', CAST(NULL AS BIGINT))");
}

@Test
public void testUuidDistinct()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BryanCutler : We should check how this works in Prestissimo as well. Don't anticipate a problem, but it would be good to make it part of the tests.

{
assertions.assertQuery(
"SELECT DISTINCT uuid_col " +
"FROM (VALUES (UUID'be0b0518-35a1-4d10-b7f1-1b61355fa741')," +
" (UUID'be0b0518-35a1-4d10-b7f1-1b61355fa741')) AS t (uuid_col)",
"VALUES UUID'be0b0518-35a1-4d10-b7f1-1b61355fa741'");
}
}