yihua commented on code in PR #12283:
URL: https://github.com/apache/hudi/pull/12283#discussion_r1847228455


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HiveHoodieReaderContext.java:
##########
@@ -265,10 +266,10 @@ public UnaryOperator<ArrayWritable> projectRecord(Schema 
from, Schema to, Map<St
   @Override
   public Comparable castValue(Comparable value, Schema.Type newType) {
     //TODO: [HUDI-8261] actually do casting here
-    if (newType == Schema.Type.STRING) {
-      return value.toString();
+    if (value instanceof WritableComparable) {
+      return value;
     }
-    return value;
+    return (WritableComparable) 
HoodieRealtimeRecordReaderUtils.avroToArrayWritable(value, 
Schema.create(newType));

Review Comment:
   Could we unit test this?



-- 
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]

Reply via email to