phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shehzaad Nakhoda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4418) UPPER() and LOWER() functions should be locale-aware
Date Mon, 05 Mar 2018 07:04:00 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-4418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16385683#comment-16385683
] 

Shehzaad Nakhoda commented on PHOENIX-4418:
-------------------------------------------

Hi [~tdsilva]

A lot of these failures are being caused by the expression 
UPPER(NAME)
being rendered as 
UPPER(NAME, )

in things like column headings.

For example:
{{0: jdbc:phoenix:> create table hello_table (ID DECIMAL PRIMARY KEY, NAME VARCHAR);
No rows affected (2.252 seconds)
0: jdbc:phoenix:> upsert into hello_table values(1, 'abc');
1 row affected (0.03 seconds)
0: jdbc:phoenix:> select upper(name) from hello_table;
+----------------+
| UPPER(NAME, )  |
+----------------+
| ABC            |
+----------------+
0: jdbc:phoenix:> select substr(name, 1) from hello_table;
+--------------------+
| SUBSTR(NAME, 1, )  |
+--------------------+
| abc                |
+--------------------+
}}

I tried this with other functions that have optional parameters like SUBSTR and saw the same
effect.

And this is trickling into EXPLAIN plan as well. 

Looks to me like there's a bug - 
SUBSTR(NAME, 1) should be represented as SUBSTR(NAME, 1) not as SUBSTR(NAME, 1, )

Given this, should I update the assert in the tests?

> UPPER() and LOWER() functions should be locale-aware
> ----------------------------------------------------
>
>                 Key: PHOENIX-4418
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4418
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.13.0
>            Reporter: Shehzaad Nakhoda
>            Assignee: Shehzaad Nakhoda
>            Priority: Major
>             Fix For: 4.14.0
>
>         Attachments: PHOENIX-4418_v1.patch
>
>
> Correct conversion of a string to upper or lower case depends on Locale.
> Java's upper case and lower case conversion routines allow passing in a locale.
> It should be possible to pass in a locale to UPPER() and LOWER() in Phoenix so that locale-specific
case conversion can be supported in Phoenix.
> See java.lang.String#toUpperCase()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message