[HUDI-1662] Fix hive date type conversion for mor table (#2634)
This commit is contained in:
@@ -33,6 +33,7 @@ import org.apache.avro.generic.GenericRecord;
|
|||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
|
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
|
||||||
|
import org.apache.hadoop.hive.serde2.io.DateWritable;
|
||||||
import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
|
import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
|
||||||
import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
|
import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
|
||||||
import org.apache.hadoop.hive.serde2.typeinfo.HiveDecimalUtils;
|
import org.apache.hadoop.hive.serde2.typeinfo.HiveDecimalUtils;
|
||||||
@@ -166,6 +167,9 @@ public class HoodieRealtimeRecordReaderUtils {
|
|||||||
case BYTES:
|
case BYTES:
|
||||||
return new BytesWritable(((ByteBuffer)value).array());
|
return new BytesWritable(((ByteBuffer)value).array());
|
||||||
case INT:
|
case INT:
|
||||||
|
if (schema.getLogicalType() != null && schema.getLogicalType().getName().equals("date")) {
|
||||||
|
return new DateWritable((Integer) value);
|
||||||
|
}
|
||||||
return new IntWritable((Integer) value);
|
return new IntWritable((Integer) value);
|
||||||
case LONG:
|
case LONG:
|
||||||
return new LongWritable((Long) value);
|
return new LongWritable((Long) value);
|
||||||
|
|||||||
Reference in New Issue
Block a user