drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Altekruse (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DRILL-4225) TestDateFunctions#testToChar fails when the locale is non-English
Date Tue, 09 Feb 2016 00:56:18 GMT

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

Jason Altekruse resolved DRILL-4225.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.6.0

Fixed in 4e9b82562cf0fc46e759b89857ffb85e129a178b

> TestDateFunctions#testToChar fails when the locale is non-English
> -----------------------------------------------------------------
>
>                 Key: DRILL-4225
>                 URL: https://issues.apache.org/jira/browse/DRILL-4225
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 1.4.0
>         Environment: Mac OS X 10.10.5
>            Reporter: Akihiko Kusanagi
>             Fix For: 1.6.0
>
>
> Set the locale to ja_JP on Mac OS X: 
> {noformat}
> $ defaults read -g AppleLocale
> ja_JP
> {noformat}
> TestDateFunctions#testToChar fails with the following output:
> {noformat}
> Running org.apache.drill.exec.fn.impl.TestDateFunctions#testToChar
> 2008-2-23
> 12 20 30
> 2008 2 23 12:00:00
> ...
> Tests run: 6, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 14.333 sec <<<
FAILURE! - in org.apache.drill.exec.fn.impl.TestDateFunctions
> testToChar(org.apache.drill.exec.fn.impl.TestDateFunctions)  Time elapsed: 2.793 sec
 <<< FAILURE!
> org.junit.ComparisonFailure: expected:<2008-[Feb]-23> but was:<2008-[2]-23>
> 	at org.apache.drill.exec.fn.impl.TestDateFunctions.testCommon(TestDateFunctions.java:66)
> 	at org.apache.drill.exec.fn.impl.TestDateFunctions.testToChar(TestDateFunctions.java:139)
> ...
> Failed tests: 
>   TestDateFunctions.testToChar:139->testCommon:66 expected:<2008-[Feb]-23> but
was:<2008-[2]-23>
> {noformat}
> Test queries are like this:
> {noformat}
> to_char((cast('2008-2-23' as date)), 'yyyy-MMM-dd')
> to_char(cast('12:20:30' as time), 'HH mm ss')
> to_char(cast('2008-2-23 12:00:00' as timestamp), 'yyyy MMM dd HH:mm:ss')
> {noformat}
> This failure occurs because org.joda.time.format.DateTimeFormat interprets the pattern
'MMM' differently depending on the locale. This will probably occur in other OS platforms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message