zaza commented on code in PR #9064:
URL: https://github.com/apache/hudi/pull/9064#discussion_r1246504222


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/HoodieCDCRDD.scala:
##########
@@ -561,7 +561,7 @@ class HoodieCDCRDD(
       originTableSchema.structTypeSchema.zipWithIndex.foreach {
         case (field, idx) =>
           if (field.dataType.isInstanceOf[StringType]) {
-            map(field.name) = record.getString(idx)
+            map(field.name) = 
Option(record.getUTF8String(idx)).map(_.toString).orNull
           } else {

Review Comment:
   Absolutely, the only problem is that I don't see any unit tests for the cdc 
package so it's hard to follow existing examples. I tried implementing a test 
that extends `HoodieClientTestBase` but that was getting me far from the 
requested "unit test". What would be the best way to start with tests for this 
particular issue?



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