Skip to content

Commit

Permalink
Fix TextConverter inefficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
cengle committed Apr 19, 2012
1 parent 5704958 commit bc14411
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ public Text convert(Object input) {
t.set(String.valueOf(((DoubleObjectInspector) inputOI).get(input)));
return t;
case STRING:
t.set(((StringObjectInspector) inputOI).getPrimitiveJavaObject(input));
if (inputOI.preferWritable()) {
t.set(((StringObjectInspector) inputOI).getPrimitiveWritableObject(input));
} else {
t.set(((StringObjectInspector) inputOI).getPrimitiveJavaObject(input));
}
return t;
default:
throw new RuntimeException("Hive 2 Internal error: type = " + inputOI.getTypeName());
Expand Down

0 comments on commit bc14411

Please sign in to comment.