alexeykudinkin commented on code in PR #5791:
URL: https://github.com/apache/hudi/pull/5791#discussion_r899366283


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieBaseRelation.scala:
##########
@@ -509,12 +510,21 @@ abstract class HoodieBaseRelation(val sqlContext: 
SQLContext,
     StructType(dataStructSchema.filterNot(f => 
partitionColumns.contains(f.name)))
 
   private def isSchemaEvolutionEnabled = {
+    // Auto set schema evolution
+    def detectSchemaEvolution(): Boolean = {
+      val result = metaClient.isValidHistorySchemaExist
+      if (result) {
+        
sparkSession.sessionState.conf.setConfString(DataSourceReadOptions.SCHEMA_EVOLUTION_ENABLED.key,
 result.toString)

Review Comment:
   Why are we overriding configuration here? I don't think we should be 
overriding the configs in such a way



##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java:
##########
@@ -553,6 +555,32 @@ public HoodieTimeline getCommitTimeline() {
     }
   }
 
+  /**
+   * Return whether an available historySchema file exist in schema folder or 
not.
+   */
+  public boolean isValidHistorySchemaExist() {

Review Comment:
   What's history-schema?



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