Mike Peterson created PIG-3574:
----------------------------------
Summary: ToDate() can't handle some custom time formats
Key: PIG-3574
URL: https://issues.apache.org/jira/browse/PIG-3574
Project: Pig
Issue Type: Bug
Affects Versions: 0.11.1, 0.12.0, 0.11
Reporter: Mike Peterson
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|http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html#timezone]
and documentation [here|http://www.joda.org/joda-time/key_format.html],
respectively). However, using this violates Pigs grammar and results in an
error.
This can be successfully escaped by using something like \'EDT\' 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.
--
This message was sent by Atlassian JIRA
(v6.1#6144)