leesf commented on a change in pull request #2645:
URL: https://github.com/apache/hudi/pull/2645#discussion_r614133690



##########
File path: 
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/MergeOnReadSnapshotRelation.scala
##########
@@ -61,8 +62,17 @@ class MergeOnReadSnapshotRelation(val sqlContext: SQLContext,
   private val jobConf = new JobConf(conf)
   // use schema from latest metadata, if not present, read schema from the 
data file
   private val schemaUtil = new TableSchemaResolver(metaClient)
-  private val tableAvroSchema = schemaUtil.getTableAvroSchema
-  private val tableStructSchema = 
AvroConversionUtils.convertAvroSchemaToStructType(tableAvroSchema)
+  private lazy val tableAvroSchema = {
+    try {
+      schemaUtil.getTableAvroSchema
+    } catch {
+      case _: Throwable => // If this is no commit in the table, we cann't get 
the schema

Review comment:
       this -> there




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to