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


Reply via email to