danny0405 commented on code in PR #13711:
URL: https://github.com/apache/hudi/pull/13711#discussion_r2289987780


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/EightToNineUpgradeHandler.java:
##########
@@ -209,4 +229,24 @@ static void 
populateIndexVersionIfMissing(Option<HoodieIndexMetadata> indexDefOp
           }
         }));
   }
+
+  /**
+   * Drop logical type indexes since we support them correctly now.
+   */
+  static List<String> mdtPartitionsToDrop(Option<HoodieIndexMetadata> 
indexDefOption, Schema tableSchema) {
+    Set<String> partitionsToDrop = new HashSet<>();
+    indexDefOption.ifPresent(idxDefs ->
+        idxDefs.getIndexDefinitions().forEach((indexName, idxDef) -> {
+          if (idxDef.getVersion() == null || 
idxDef.getVersion().lowerThan(HoodieIndexVersion.V2)) {
+            idxDef.getSourceFields().stream().filter(field -> {
+              Option<Schema> schema = 
AvroSchemaUtils.findNestedFieldSchema(tableSchema, field);
+              if (schema.isEmpty()) {

Review Comment:
   schema..isPresent ?



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