Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hive3.0 compiles and reports an error. Instead of the specific implementation class, WritableComparable accepts the return, and the compilation passes #943

Merged
merged 1 commit into from
Aug 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -175,8 +176,8 @@ public static void serialize(ByteStream.Output out, Object obj, ObjectInspector
}
}
private static void writePrimitiveUTF8(OutputStream out, Object o,
PrimitiveObjectInspector oi, boolean escaped, byte escapeChar,
boolean[] needsEscape) throws IOException {
PrimitiveObjectInspector oi, boolean escaped, byte escapeChar,
boolean[] needsEscape) throws IOException {

PrimitiveObjectInspector.PrimitiveCategory category = oi.getPrimitiveCategory();
byte[] binaryData = null;
Expand Down Expand Up @@ -237,12 +238,12 @@ private static void writePrimitiveUTF8(OutputStream out, Object o,
break;
}
case DATE: {
DateWritable dw = ((DateObjectInspector) oi).getPrimitiveWritableObject(o);
WritableComparable dw = ((DateObjectInspector) oi).getPrimitiveWritableObject(o);
binaryData = Base64.encodeBase64(String.valueOf(dw).getBytes());
break;
}
case TIMESTAMP: {
TimestampWritable tw = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o);
WritableComparable tw = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o);
binaryData = Base64.encodeBase64(String.valueOf(tw).getBytes());
break;
}
Expand Down