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



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java
##########
@@ -212,10 +218,10 @@ public Schema 
getTableAvroSchemaWithoutMetadataFields(HoodieInstant instant) thr
    */
   private Option<Schema> getTableSchemaFromCommitMetadata(boolean 
includeMetadataFields) {
     HoodieTimeline timeline = 
metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants();
-    return getTableSchemaFromCommitMetadata(timeline.lastInstant().get(), 
includeMetadataFields);
+    return timeline.lastInstant().isPresent() ? 
getTableSchemaFromCommitMetadata(timeline.lastInstant().get(), 
includeMetadataFields) :

Review comment:
       would we move `timeline.lastInstant().isPresent()` inside 
`getTableSchemaFromCommitMetadata(HoodieInstant instant, boolean 
includeMetadataFields)`?




-- 
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:
[email protected]


Reply via email to