drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4225) TestDateFunctions#testToChar fails when the locale is non-English
Date Sat, 26 Dec 2015 17:06:49 GMT

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

ASF GitHub Bot commented on DRILL-4225:
---------------------------------------

GitHub user nagix opened a pull request:

    https://github.com/apache/drill/pull/311

    DRILL-4225 TestDateFunctions#testToChar fails when the locale is non-English

    - Changed to use LocalDate, LocalTime and LocalDateTime to build expectedResults instead
of string literals

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nagix/drill drill-4225

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/311.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #311
    
----
commit 0f693f954cc1e5acc5e90cbdfe1d1fac2938ab5d
Author: Akihiko Kusanagi <akusanagi@mapr.com>
Date:   2015-12-26T17:02:03Z

    DRILL-4225 TestDateFunctions#testToChar fails when the locale is non-English
    - Changed to use LocalDate, LocalTime and LocalDateTime to build expectedResults instead
of string literals

----


> 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
>
> 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