Skip to content

fix string array grouping comparator#17183

Merged
LakshSingla merged 1 commit intoapache:masterfrom
clintropolis:fix-array-string-comparator
Oct 8, 2024
Merged

fix string array grouping comparator#17183
LakshSingla merged 1 commit intoapache:masterfrom
clintropolis:fix-array-string-comparator

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Fixes an issue that can occur when grouping on a string array and sorting by it, where we were not checking for the 'natural' comparator.

Copy link
Copy Markdown
Contributor

@LakshSingla LakshSingla left a comment

Choose a reason for hiding this comment

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

LGTM, wondering if we should make this change more generic

Comment on lines +2200 to +2205
private static boolean useNaturalStringArrayComparator(@Nullable StringComparator stringComparator)
{
return stringComparator == null
|| StringComparators.NATURAL.equals(stringComparator)
|| StringComparators.LEXICOGRAPHIC.equals(stringComparator);
}
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.

Should the method DimensionComparisonUtils#isNaturalComparator need to be updated instead, since this looks like a generic bug that may exist if someone's using that method with array elements?

@LakshSingla LakshSingla merged commit ab0d6eb into apache:master Oct 8, 2024
@adarshsanjeev adarshsanjeev added this to the 32.0.0 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants