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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -719,28 +686,19 @@ static void 
validateEligibilityForSecondaryOrExpressionIndex(HoodieTableMetaClie
     String columnName = sourceFields.get(0); // We know there's only one 
column from the check above

Review Comment:
   Yes, this is intentional and functionally equivalent to the previous logic.
   
   The previous method signature accepted a List and iterated over it, the 
calling method `getSecondaryOrExpressionIndexDefinition` enforces that only a 
single column is involved just before calling validation:
   
   ```java
   checkArgument(columns.size() == 1, "Only one column can be indexed for 
functional or secondary index.");
   ```
   
   Since we are guaranteed to have exactly one field, the previous loop was 
effectively only ever checking the first element. This refactor just makes that 
assumption explicit by grabbing `.get(0)` directly, rather than pretending we 
might need to validate multiple fields.



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