Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add list of collations that are required to determine equality. #9757

Merged
merged 5 commits into from Nov 22, 2023

Conversation

Tmonster
Copy link
Contributor

For some collations, we cannot do a normal byte comparison for equality. The collation information is needed instead.

"da" Is the only one I know of so far. @carlopi has suggested to write a script to check all collations and character equalities to see if there are other collations that are required to evaluate equality.

CreateCollationInfo::CreateCollationInfo(string name_p, ScalarFunction function_p, bool combinable_p,
bool not_required_for_equality_p)
: CreateInfo(CatalogType::COLLATION_ENTRY), function(std::move(function_p)), combinable(combinable_p),
not_required_for_equality(not_required_for_equality_p) {
this->name = std::move(name_p);
if (equality_requires_collation.count(this->name) > 0) {
this->not_required_for_equality = false;
Copy link
Collaborator

@Mytherin Mytherin Nov 22, 2023

Choose a reason for hiding this comment

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

This should be fixed where the CreateCollationInfo is created (IcuExtension::Load in icu-extension.cpp). I would also say let's set this to false for all ICU collations until we have more info on which collations require this

@guihembichot
Copy link

I hope I can add a comment here. The wrong results with collation "da", are also observed with other ICU collations (tried "de"). It's not due to a special collation.
And, it would be interesting to have, in the test queries which use GROUP BY, the printout of the group column ('s') too, on top of COUNT(*); to verify that the building of groups, which transforms values of 's' into equivalent ones, leaves a final correct 's' after grouping (probably one of the two original strings in the table, but not something else).

@github-actions github-actions bot marked this pull request as draft November 22, 2023 11:33
@@ -2,6 +2,8 @@

namespace duckdb {

static unordered_set<string> const equality_requires_collation = {"da"};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove this as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Tmonster Tmonster marked this pull request as ready for review November 22, 2023 12:38
Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@Mytherin Mytherin merged commit 2c6334d into duckdb:main Nov 22, 2023
44 of 45 checks passed
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 14, 2023
Merge pull request duckdb/duckdb#9772 from hawkfish/skiplist-rand
Merge pull request duckdb/duckdb#9767 from samansmink/fix-vcpkg-patching-on-windows
Merge pull request duckdb/duckdb#9757 from Tmonster/712-unicode-bugs
Merge pull request duckdb/duckdb#9758 from samansmink/fix-issue-9727
Merge pull request duckdb/duckdb#9759 from samansmink/update-vcpkg-2023.10.19
Merge pull request duckdb/duckdb#9761 from samansmink/add-nightly-deploy-script
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.

None yet

3 participants