voonhous commented on code in PR #17599:
URL: https://github.com/apache/hudi/pull/17599#discussion_r2643546857


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -136,10 +135,10 @@ public static List<HoodieBaseFile> 
getLatestBaseFilesForPartition(String partiti
    * @param tableSchema  table schema
    * @return true if each field's data type are supported for secondary index, 
false otherwise
    */
-  static boolean validateDataTypeForSecondaryIndex(List<String> sourceFields, 
Schema tableSchema) {
+  static boolean validateDataTypeForSecondaryIndex(List<String> sourceFields, 
HoodieSchema tableSchema) {
     return sourceFields.stream().allMatch(fieldToIndex -> {
-      Schema schema = getNestedFieldSchemaFromWriteSchema(tableSchema, 
fieldToIndex);
-      return isSecondaryIndexSupportedType(schema);
+      Option<Pair<String, HoodieSchemaField>> schema = 
HoodieSchemaUtils.getNestedField(tableSchema, fieldToIndex);

Review Comment:
   Yeap, no harm being more defensive here.



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