yuqi1129 commented on code in PR #7714:
URL: https://github.com/apache/gravitino/pull/7714#discussion_r2242081563
##########
common/src/main/java/org/apache/gravitino/dto/rel/PartitionUtils.java:
##########
@@ -38,7 +38,12 @@ public class PartitionUtils {
public static void validateFieldExistence(ColumnDTO[] columns, String[]
fieldName)
throws IllegalArgumentException {
Preconditions.checkArgument(ArrayUtils.isNotEmpty(columns), "columns
cannot be null or empty");
-
+ Preconditions.checkArgument(
+ fieldName != null
+ && fieldName.length > 0
+ && fieldName[0] != null
+ && !fieldName[0].trim().isEmpty(),
+ "fieldName[0] cannot be null, empty or blank");
Review Comment:
Maybe the following is sufficient.
```
Preconditions.checkArgument(ArrayUtils.isNotEmpty(fieldName), "fieldName
cannot be null or empty");
```
Anyway, the current implementation is more strict and I find it acceptable
.
--
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]