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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/RunCompactionActionExecutor.java:
##########
@@ -85,9 +86,12 @@ public HoodieWriteMetadata<HoodieData<WriteStatus>> 
execute() {
 
       // try to load internalSchema to support schema Evolution
       HoodieWriteConfig configCopy = config;
-      Pair<Option<String>, Option<String>> schemaPair = InternalSchemaCache
-          
.getInternalSchemaAndAvroSchemaForClusteringAndCompaction(table.getMetaClient(),
 instantTime);
-      if (schemaPair.getLeft().isPresent() && 
schemaPair.getRight().isPresent()) {
+      boolean schemaEvolutionEnable = new 
TableSchemaResolver(table.getMetaClient()).getTableInternalSchemaFromCommitMetadata().isPresent();
+      Pair<Option<String>, Option<String>> schemaPair = 
Pair.of(Option.empty(), Option.empty());
+      if (schemaEvolutionEnable) {
+        schemaPair = 
InternalSchemaCache.getInternalSchemaAndAvroSchemaForClusteringAndCompaction(table.getMetaClient(),
 instantTime);

Review Comment:
   Optimize the code, trigger the corresponding logic only when the schema 
evolution is enabled



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