vinishjail97 commented on a change in pull request #4509:
URL: https://github.com/apache/hudi/pull/4509#discussion_r778807350



##########
File path: 
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/IncrementalRelation.scala
##########
@@ -89,8 +89,13 @@ class IncrementalRelation(val sqlContext: SQLContext,
     } else {
       schemaResolver.getTableAvroSchemaWithoutMetadataFields()
     }
-    val dataSchema = 
AvroConversionUtils.convertAvroSchemaToStructType(tableSchema)
-    StructType(skeletonSchema.fields ++ dataSchema.fields)
+    if (tableSchema == null) {
+      // if there is only one commit in the table and is an empty commit 
without schema, return empty RDD here
+      null

Review comment:
       For some reason scala was not accepting null values to be returned, used 
`StructType(Nil)` and made the check for usedSchema accordingly. 




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