[ https://issues.apache.org/jira/browse/DRILL-6975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
benj updated DRILL-6975: ------------------------ Affects Version/s: 1.17.0 > TO_CHAR does not seems work well depends on LOCALE > -------------------------------------------------- > > Key: DRILL-6975 > URL: https://issues.apache.org/jira/browse/DRILL-6975 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill > Affects Versions: 1.14.0, 1.15.0, 1.16.0, 1.17.0 > Reporter: benj > Priority: Major > > Strange results from TO_CHAR function when using different LOCALE. > {code:java} > SELECT TO_CHAR((CAST('2008-2-23' AS DATE)), 'yyyy-MMM-dd') FROM (VALUES(1)); > 2008-Feb-23 (in documentation (en_US.UTF-8)) > 2008-févr.-2 (fr_FR.UTF-8) > {code} > surprisingly by adding a space ('yyyy-MMM-dd ') (or any character) at the end > of the format the result becomes correct (so there is no problem when format > a timestamp with 'yyyy MMM dd HH:mm:ss') > {code:java} > SELECT TO_CHAR(1256.789383, '#,###.###') FROM (VALUES(1)); > 1,256.789 (in documentation (en_US.UTF-8)) > 1 256,78 (fr_FR.UTF-8) > {code} > Even worse results can be achieved > {code:java} > SELECT TO_CHAR(12567,'#,###.###'); > 12,567 (en_US.UTF-8) > 12 56 (fr_FR.UTF-8) > {code} > Again, with the add of a space/char at the end we get a better result. > I don't have tested all the locale, but for the last example, the result is > right with de_DE.UTF-8 : 12.567 > The situation is identical in 1.14 > -- This message was sent by Atlassian Jira (v8.3.4#803005)