'Gettign error Cannot parse "000000000000": Value 0 for monthOfYear must be in the range [1,12] when I run my Pig script
Data is as below (DOB_TIME is the concatenation of DOB and TIME column):
DOB, TIME, DOB_TIME
00000000,0000,000000000000,
20210127,1214,202101271214,
00000000,0000,000000000000,
20211217,1020,202112171020,
20030326,1130,200303261130,
20210729,1459,202107291459,
20201214,1543,202012141543,
20000814,1843,200008141843,
00000000,1643,000000001643,
When I try to convert the date time column- DOB_TIME in format- 'ddMMMyyyy:HH:mm' with this code snippet
ToString(ToDate(DOB_TIME, 'yyyyMMddHHmm'), 'ddMMMyyyy:HH:mm') as DOB_TIME,
I'm getting error:
2022-02-08 04:32:45,259 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Unable to recreate exception from backed error: Error: org.apache.pig.backend.executionengine.ExecException: ERROR 0: Exception while executing [POUserFunc (Name: POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime] - scope-31466 Operator Key: scope-31466) children: null at []]: org.joda.time.IllegalFieldValueException: Cannot parse "000000000000": Value 0 for monthOfYear must be in the range [1,12]
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:364)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.processInput(POUserFunc.java:220)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.getNext(POUserFunc.java:274)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.getNextString(POUserFu
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
