Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.11, 0.12.0, 0.11.1
-
None
-
None
-
None
-
ToDate, Joda
Description
When trying to parse a string with a format as follows Fri Nov 01 12:30:19 EDT 2013 there is no way to properly escape the EDT timezone. Both SimpleDate and Joda time provide the single quote character ' to escape custom text (see the examples here and documentation here, respectively). However, using this violates Pigs grammar and results in an error.
This can be successfully escaped by using something like ToDate(date,'EEE MMM dd HH:mm:ss \'EDT\' yyyy', 'EST') and a date time will be returned. This introduces new problems, when you try something like a filter, the next line will throw an error (usually mismatched input '(' expecting SEMI_COLON). I believe this is a result of violating Pigs grammar once again.
The problem here is that any datetime string that has a custom format can't be parsed (such as Nov 11th at 12:05, both due to the th and the at).