danny0405 commented on code in PR #10904:
URL: https://github.com/apache/hudi/pull/10904#discussion_r1534863672
##########
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:
will it yields an empty data frame here?
--
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]