yihua commented on code in PR #14351:
URL: https://github.com/apache/hudi/pull/14351#discussion_r2563641829
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/InternalRowToJsonStringConverter.scala:
##########
@@ -36,15 +37,63 @@ class InternalRowToJsonStringConverter(schema: StructType) {
}
def convert(record: InternalRow): UTF8String = {
- val map = scala.collection.mutable.Map.empty[String, Any]
+ // Use LinkedHashMap to preserve field order
+ val map = scala.collection.mutable.LinkedHashMap.empty[String, Any]
schema.zipWithIndex.foreach {
case (field, idx) =>
- if (field.dataType.isInstanceOf[StringType]) {
- map(field.name) =
Option(record.getUTF8String(idx)).map(_.toString).orNull
Review Comment:
Have you run a functional test on Spark with CDC to verify that `StringType`
column still works?
--
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]