xiarixiaoyao commented on code in PR #5343:
URL: https://github.com/apache/hudi/pull/5343#discussion_r852017845


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DefaultSource.scala:
##########
@@ -98,6 +99,7 @@ class DefaultSource extends RelationProvider
     val isBootstrappedTable = 
metaClient.getTableConfig.getBootstrapBasePath.isPresent
     val tableType = metaClient.getTableType
     val queryType = parameters(QUERY_TYPE.key)
+    val enableSchemaOnRead = parameters.getOrElse(SCHEMA_EVOLUTION_ENABLE.key, 
SCHEMA_EVOLUTION_ENABLE.defaultValue.toString).toBoolean
     val userSchema = if (schema == null) Option.empty[StructType] else 
Some(schema)

Review Comment:
   maybe it better to use follow code.  
   ```
             val enableSchemaOnRead: Boolean = try {
               !(new 
TableSchemaResolver(metaClient).getTableInternalSchemaFromCommitMetadata.orElse(InternalSchema.getEmptyInternalSchema)).isEmptySchema
             } catch {
               case _: Exception => false
             }
   ```



-- 
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-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to