drill-dev mailing list archives

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

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