jerryshao commented on code in PR #7876:
URL: https://github.com/apache/gravitino/pull/7876#discussion_r2286869971
##########
server/src/main/java/org/apache/gravitino/server/web/rest/StatisticOperations.java:
##########
@@ -428,38 +427,32 @@ public Response dropPartitionStatistics(
}
}
+ @VisibleForTesting
+ static PartitionRange.BoundType getFromBoundType(boolean inclusive) {
+ return inclusive ? PartitionRange.BoundType.CLOSED :
PartitionRange.BoundType.OPEN;
+ }
+
private static String getFormattedFromPartitionName(
- String fromPartitionName, boolean fromExclusive) {
- if (fromExclusive) {
- Preconditions.checkArgument(
- StringUtils.isNotBlank(fromPartitionName),
- "'from' partition name must not be null or empty when
'fromExclusive' is true");
- return "[" + fromPartitionName;
+ String fromPartitionName, boolean fromInclusive) {
+ if (fromPartitionName == null) {
+ return "(-INF";
} else {
- if (fromPartitionName == null) {
- return "(-INF";
- } else {
+ if (fromInclusive) {
return "(" + fromPartitionName;
+ } else {
+ return "[" + fromPartitionName;
}
}
}
- @VisibleForTesting
- static PartitionRange.BoundType getFromBoundType(boolean exclusive) {
- return exclusive ? PartitionRange.BoundType.CLOSED :
PartitionRange.BoundType.OPEN;
- }
-
- private static String getFormattedToPartitionName(String toPartitionName,
boolean toExclusive) {
- if (toExclusive) {
- Preconditions.checkArgument(
- StringUtils.isNotBlank(toPartitionName),
- "'to' partition name must not be null or empty when 'toExclusive' is
true");
- return toPartitionName + "]";
+ private static String getFormattedToPartitionName(String toPartitionName,
boolean toInclusive) {
+ if (toPartitionName == null) {
+ return "INF)";
} else {
- if (toPartitionName == null) {
- return "INF)";
- } else {
+ if (toInclusive) {
return toPartitionName + ")";
Review Comment:
Should you change to `]` for `toInclusive` setting to true?
--
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]