pramodbiligiri commented on code in PR #7864:
URL: https://github.com/apache/hudi/pull/7864#discussion_r1099939380
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DefaultSource.scala:
##########
@@ -241,7 +241,12 @@ object DefaultSource {
}
if (metaClient.getCommitsTimeline.filterCompletedInstants.countInstants()
== 0) {
- new EmptyRelation(sqlContext, resolveSchema(metaClient, parameters,
Some(schema)))
+ val structType = resolveSchema(metaClient, parameters, Some(schema))
Review Comment:
Perhaps this bit from my JIRA ticket can help? "If there are no completed
instants in the table, and there is no user defined schema for it as well (as
represented by the userSpecifiedSchema field in DataSource.scala), then the
EmptyRelation returned by DefaultSource.createRelation sets schema of the
EmptyRelation to null. This breaks the contract of Spark's BaseRelation, where
the schema is a StructType but is not expected to be null."
Edit: If you see the 3rd and 4th screenshots in the JIRA
(https://issues.apache.org/jira/browse/HUDI-5688) you'll see that
TableSchemaResolver.getTableAvroSchema() throws an Exception. I didn't debug
beyond that.
--
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]