diff --git serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyHiveDecimal.java serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyHiveDecimal.java index fcf1ac6..f672112 100644 --- serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyHiveDecimal.java +++ serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyHiveDecimal.java @@ -58,7 +58,7 @@ public LazyHiveDecimal(LazyHiveDecimal copy) { } /** - * Initilizes LazyHiveDecimal object by interpreting the input bytes + * Initializes LazyHiveDecimal object by interpreting the input bytes * as a numeric string * * @param bytes @@ -92,11 +92,6 @@ private HiveDecimal enforcePrecisionScale(HiveDecimal dec) { return HiveDecimalUtils.enforcePrecisionScale(dec, precision, scale); } - @Override - public HiveDecimalWritable getWritableObject() { - return data; - } - /** * Writes HiveDecimal object to output stream as string * @param outputStream diff --git serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyPrimitive.java serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyPrimitive.java index 32224a8..d4ec2e4 100644 --- serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyPrimitive.java +++ serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyPrimitive.java @@ -62,16 +62,14 @@ public boolean equals(Object obj) { if (!(obj instanceof LazyPrimitive)) { return false; } - - if (data == obj) { + if (this == obj) { return true; } - - if (data == null || obj == null) { + LazyPrimitive other = (LazyPrimitive) obj; + if (isNull || other.isNull) { return false; } - - return data.equals(((LazyPrimitive) obj).getWritableObject()); + return data == other.data || data.equals(other.data); } public void logExceptionMessage(ByteArrayRef bytes, int start, int length, String dataType) { diff --git serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyTimestamp.java serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyTimestamp.java index 27895c5..a8e2a96 100644 --- serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyTimestamp.java +++ serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyTimestamp.java @@ -49,7 +49,7 @@ public LazyTimestamp(LazyTimestamp copy) { } /** - * Initilizes LazyTimestamp object by interpreting the input bytes + * Initializes LazyTimestamp object by interpreting the input bytes * as a JDBC timestamp string * * @param bytes @@ -82,8 +82,6 @@ public void init(ByteArrayRef bytes, int start, int length) { data.set(t); } - private static final String nullTimestamp = "NULL"; - /** * Writes a Timestamp in JDBC timestamp format to the output stream * @param out @@ -101,9 +99,4 @@ public static void writeUTF8(OutputStream out, TimestampWritable i) out.write(i.toString().getBytes("US-ASCII")); } } - - @Override - public TimestampWritable getWritableObject() { - return data; - } }