Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.0
-
None
-
Mac OS X 10.10.5
Description
Set the locale to ja_JP on Mac OS X:
$ defaults read -g AppleLocale ja_JP
TestDateFunctions#testToChar fails with the following output:
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>
Test queries are like this:
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')
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.