thomasrebele commented on code in PR #6900:
URL: https://github.com/apache/hive/pull/6900#discussion_r4337706589
##########
serde/src/java/org/apache/hadoop/hive/serde2/OpenCSVSerde.java:
##########
@@ -131,6 +132,10 @@ public Writable doSerialize(Object obj, ObjectInspector
objInspector) throws Ser
} else if (fieldOI instanceof AbstractPrimitiveWritableObjectInspector) {
Object primitiveJavaObject =
((AbstractPrimitiveWritableObjectInspector)
fieldOI).getPrimitiveJavaObject(field);
outputFields[c] = Objects.toString(primitiveJavaObject, null);
+ } else if (fieldOI instanceof AbstractPrimitiveLazyObjectInspector) {
+ Object primitiveJavaObject =
+ ((AbstractPrimitiveLazyObjectInspector<?>)
fieldOI).getPrimitiveWritableObject(field);
+ outputFields[c] = Objects.toString(primitiveJavaObject, null);
} else {
Review Comment:
If the `field` is already a String, we can avoid converting it to a Text,
which copies the String's content to a ByteBuffer, and then back to String. I'm
not sure under which circumstances that happens, but the String to Text
conversion in getPrimitiveWritableObject exists for JavaStringObjectInspector
and ParquetStringInspector.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]