You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/02/23 01:39:14 UTC
[GitHub] [hudi] leesf commented on a change in pull request #4773: [HUDI-3400] Avoid throw exception when create hoodie table
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org