phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-4237) Allow sorting on (Java) collation keys for non-English locales
Date Fri, 20 Oct 2017 17:26:00 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Taylor updated PHOENIX-4237:
----------------------------------
    Attachment: PHOENIX-4237_v1.patch

[~shehzaadn] - here's your patch with a couple of minor tweaks:
- removed @author tags which ASF frowns on
- tweaked CollationKeyFunction.evaluate to return false if the string argument could not be
evaluated. This isn't an error condition, but may just mean that the underlying data has not
been retrieved yet.
- removed resulting unused code
- lowered log level to trace for your debugging since some organizations run with debug on
(and those messages would generate a ton of log messages, i.e. multiple lines per row).

If I attempt to run the unit tests, I get this error message, though. Please advise.
{code}
[ERROR] testCollationKeyBytesForPrimaryStrength(org.apache.phoenix.expression.function.CollationKeyFunctionTest)
 Time elapsed: 0.008 s  <<< ERROR!
java.lang.UnsupportedClassVersionError: com/force/i18n/LocaleUtils : Unsupported major.minor
version 52.0
	at org.apache.phoenix.expression.function.CollationKeyFunctionTest.testExpression(CollationKeyFunctionTest.java:199)
	at org.apache.phoenix.expression.function.CollationKeyFunctionTest.testExpression(CollationKeyFunctionTest.java:183)
	at org.apache.phoenix.expression.function.CollationKeyFunctionTest.test(CollationKeyFunctionTest.java:163)
	at org.apache.phoenix.expression.function.CollationKeyFunctionTest.testMultiple(CollationKeyFunctionTest.java:157)
	at org.apache.phoenix.expression.function.CollationKeyFunctionTest.testCollationKeyBytesForPrimaryStrength(CollationKeyFunctionTest.java:111)
{code}

> Allow sorting on (Java) collation keys for non-English locales
> --------------------------------------------------------------
>
>                 Key: PHOENIX-4237
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4237
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Shehzaad Nakhoda
>            Assignee: Shehzaad Nakhoda
>             Fix For: 4.12.0
>
>         Attachments: PHOENIX-4237_v1.patch
>
>
> Strings stored via Phoenix can be composed from a subset of the entire set of Unicode
characters. The natural sort order for strings for different languages often differs from
the order dictated by the binary representation of the characters of these strings. Java provides
the idea of a Collator which given an input string and a (language) locale can generate a
Collation Key which can then be used to compare strings in that natural order.
> Salesforce has recently open-sourced grammaticus. IBM has open-sourced ICU4J some time
ago. These technologies can be combined to provide a robust new Phoenix function that can
be used in an ORDER BY clause to sort strings according to the user's locale.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message