jonvex commented on code in PR #10904:
URL: https://github.com/apache/hudi/pull/10904#discussion_r1536639905


##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/AvroConversionUtils.scala:
##########
@@ -98,13 +98,10 @@ object AvroConversionUtils {
    */
   def createDataFrame(rdd: RDD[GenericRecord], schemaStr: String, ss: 
SparkSession): Dataset[Row] = {
     ss.createDataFrame(rdd.mapPartitions { records =>
-      if (records.isEmpty) Iterator.empty
-      else {
-        val schema = new Schema.Parser().parse(schemaStr)
-        val dataType = convertAvroSchemaToStructType(schema)
-        val converter = createConverterToRow(schema, dataType)
-        records.map { r => converter(r) }
-      }
+      val schema = new Schema.Parser().parse(schemaStr)

Review Comment:
   if (records.isEmpty) Iterator.empty
   So wouldn't calling records.map still be empty?
   No one I've asked so far knows why we did this, but I am also hesitant to 
make this change as well



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