Skip to content

Comments

Fix UUID distinct operation issue#23732

Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom
abhibongale:distinct-operation-on-uuid-fails
Oct 7, 2024
Merged

Fix UUID distinct operation issue#23732
tdcmeehan merged 1 commit intoprestodb:masterfrom
abhibongale:distinct-operation-on-uuid-fails

Conversation

@abhibongale
Copy link
Contributor

@abhibongale abhibongale commented Sep 26, 2024

  • Addressed UnsupportedOperationException when using GROUP BY with UUIDs.
  • Updated UuidOperators to support distinct operations correctly.
  • Added tests in TestDistinctAggregations to validate the fix.
  • Implemented a fix based on Trino's solution to ensure proper handling of UUID comparison.
  • Cherry picked from commit trinodb/trino#1180 by guyco33

Description

This commit resolves an issue with the UUID type in PrestoDB, where performing a GROUP BY operation on UUIDs resulted in an UnsupportedOperationException. The fix aligns with a solution implemented in Trino, ensuring that UUID comparison works correctly during aggregation.

Motivation and Context

This change is required to allow users to perform GROUP BY operations on UUIDs without encountering errors. It addresses the bug reported in issue #23554, enabling proper usage of UUIDs in queries.

Test Plan

The solution was tested by adding unit tests in TestDistinctAggregations, which cover various scenarios of using distinct operations on UUIDs. All tests passed successfully, confirming the correctness of the implementation.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

  • Fix distinct operator for UUID type :pr:23732.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 26, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: abhibongale / name: Abhishek Bongale (73b546f)

@tdcmeehan
Copy link
Contributor

Code looks good @abhibongale, thanks for the pull request!

It looks like this is a cherry pick from Trino. Please attribute it in the commit message (see contributing guide).

@tdcmeehan
Copy link
Contributor

Almost there. Please use this commit message which will show attribution in Github.

Fix distinct operator for UUID

Cherry-pick of  https://github.com/trinodb/trino/pull/1180 by guyco33
Co-authored-by: Guy Cohen <guyco33@gmail.com>

}

@Test
public void testUuidDistinct()
Copy link
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.

Copy link
Member

@imjalpreet imjalpreet left a comment

Choose a reason for hiding this comment

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

@abhibongale Thanks for the contribution, I have re-triggered your failed test.

A small request, please rebase your branch on master rather than using merge. Merge results in an extra commit as you can see.

Cherry-pick of  trinodb/trino#1180 by guyco33
Co-authored-by: Guy Cohen <guyco33@gmail.com>
@tdcmeehan tdcmeehan merged commit 88c03ab into prestodb:master Oct 7, 2024
@jaystarshot jaystarshot mentioned this pull request Nov 1, 2024
25 tasks
@jaystarshot
Copy link
Member

Please consider adding release notes following our release notes guide - link.

Using below for now

* Fix distinct operator for UUID type :pr:`23732`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants