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

Conversation

Zosimer
Copy link
Contributor

@Zosimer Zosimer commented Aug 7, 2021

image
The DateWritable class in hive3.1.2 has been abandoned and replaced by DateWritableV2. We can use the common parent class of DateWritableV2 and DateWritable to receive the return value, so that it can be compatible with previous and future versions of hive
case DATE: {
WritableComparable dw = ((DateObjectInspector) oi).getPrimitiveWritableObject(o);
binaryData = Base64.encodeBase64(String.valueOf(dw).getBytes());
break;
}
case TIMESTAMP: {
WritableComparable tw = ((TimestampObjectInspector) oi).getPrimitiveWritableObject(o);
binaryData = Base64.encodeBase64(String.valueOf(tw).getBytes());
break;
}

@Zosimer Zosimer changed the title HIVE3.0 编译报错,使用WritableComparable代替具体的实现类接受返回,编译通过 Hive3.0 compiles and reports an error. Instead of the specific implementation class, writablecomparable accepts the return, and the compilation passes Aug 9, 2021
@Zosimer Zosimer changed the title Hive3.0 compiles and reports an error. Instead of the specific implementation class, writablecomparable accepts the return, and the compilation passes Hive3.0 compiles and reports an error. Instead of the specific implementation class, WritableComparable accepts the return, and the compilation passes Aug 9, 2021
Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@peacewong peacewong merged commit 907d971 into apache:dev-1.0.2 Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants