Issue 12631

DateParsingUDF out of date

12631
Reporter: kbraak
Assignee: omeyn
Type: Bug
Summary: DateParsingUDF out of date
Priority: Blocker
Resolution: Fixed
Status: Closed
Created: 2013-01-23 16:26:15.765
Updated: 2013-12-17 15:16:46.248
Resolved: 2013-02-07 15:07:03.81
        
Description: The method used to construct an occurrence date from year/month/day is out of date.

See method evaluate in: http://code.google.com/p/gbif-occurrencestore/source/browse/trunk/occurrence-store/src/main/java/org/gbif/occurrencestore/hive/udf/DateParsingUDF.java

The current year used in the comparison is out of date:

bq. if (c.get(Calendar.YEAR) < 1700 || c.get(Calendar.YEAR) > 2012)

The year has yet to be incremented.

Maybe you can try to get the year programmatically, e.g.

bq. int year = Calendar.getInstance().get(Calendar.YEAR);

See http://stackoverflow.com/questions/136419/get-integer-value-of-the-current-year-in-java for alternative solutions.]]>
    


Author: kbraak@gbif.org
Comment: This issue blocks Rollover #40. 
Created: 2013-01-23 16:51:27.303
Updated: 2013-01-23 16:51:27.303


Author: omeyn@gbif.org
Comment: I changed it to hard-coded 2013. That's crazy, but when I have to refactor the udfs to merge occurrencestore with occurrence-process i'll fix it properly.
Created: 2013-02-07 15:07:03.833
Updated: 2013-02-07 15:07:03.833