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 2021/05/10 22:31:22 UTC

[GitHub] [hudi] vinothchandar commented on a change in pull request #2903: [HUDI-1850] Fixing read of a empty table but with failed write

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



##########
File path: hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/DefaultSource.scala
##########
@@ -105,7 +105,9 @@ class DefaultSource extends RelationProvider
     val tableType = metaClient.getTableType
     val queryType = parameters(QUERY_TYPE_OPT_KEY)
     log.info(s"Is bootstrapped table => $isBootstrappedTable, tableType is: $tableType")
-
+    val schemaUtil = new TableSchemaResolver(metaClient)

Review comment:
       why though? we can create the using the test table API and read from data source right? 

##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/TableSchemaResolver.java
##########
@@ -130,7 +131,11 @@ private MessageType getTableParquetSchemaFromDataFile() throws Exception {
                     + " for file " + filePathWithFormat.getLeft());
             }
           } else {
-            return readSchemaFromLastCompaction(lastCompactionCommit);
+            if (lastCompactionCommit.isPresent()) {

Review comment:
       how about using `lastCompactionCommit.map().orElseThrow()`. instead of the if-else




-- 
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:
users@infra.apache.org