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



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java
##########
@@ -70,48 +71,42 @@ public TableSchemaResolver(HoodieTableMetaClient 
metaClient) {
     this.hasOperationField = hasOperationField();
   }
 
+  private Option<MessageType> getTableParquetSchemaFromDataFile() {
+    String dataFilePath = getValidDataFilePath().orElseThrow(() -> new 
IllegalArgumentException(
+        "Could not find any data file written for commit, so could not get 
schema for table "
+            + metaClient.getBasePath()));
+    return getTableParquetSchemaFromDataFile(dataFilePath);
+  }
+
   /**
    * Gets the schema for a hoodie table. Depending on the type of table, read 
from any file written in the latest
    * commit. We will assume that the schema has not changed within a single 
atomic write.
    *
-   * @return Parquet schema for this table
+   * @return Parquet schema for this table, or {@code Option.empty()} if read 
from the log file has no {@code HoodieDataBlock}

Review comment:
       `or {@code Option.empty()} if there is no {@code HoodieDataBlock} from 
log file`




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