package org.elasticsearch.hadoop.hive;

import java.sql.Timestamp;

import javax.xml.bind.DatatypeConverter;

import org.apache.hadoop.hive.serde2.io.TimestampWritable;
import org.elasticsearch.hadoop.mr.WritableValueReader;

public class HiveValueReader extends WritableValueReader {

    @Override
    protected Object date(String value) {
        return new TimestampWritable(new Timestamp(DatatypeConverter.parseDateTime(value).getTimeInMillis()));
    }
}
@@ -162,16 +162,54 @@
 itable;%0A
+import org.apache.hadoop.io.Writable;%0A
 import o
@@ -489,10 +489,124 @@
 );%0A    %7D
+%0A%0A    @Override%0A    protected Class%3C? extends Writable%3E dateType() %7B%0A        return TimestampWritable.class;%0A    %7D
 %0A%7D

improve hive value reader when dealing w/ nested dates