GWphua commented on code in PR #18477:
URL: https://github.com/apache/druid/pull/18477#discussion_r2320967879
##########
processing/src/main/java/org/apache/druid/java/util/common/Intervals.java:
##########
@@ -53,6 +57,46 @@ public static Interval of(String format, Object...
formatArgs)
return of(StringUtils.format(format, formatArgs));
}
+ /**
+ * @return Null if cannot parse with optimized strategy, else return the
Interval.
Review Comment:
Hi @kfaraz, thanks for the quick review. I have incorporated your
suggestions.
Regarding the short circuit, I agree we can add a short-circuit for working
with Periods , though it is hard to find an exhaustive way to cover all
fallback cases.
I have listed all cases i can think of under the test file. Here's a TLDR of
what's considered fallback.
```
// Zulu without millis
"2022-01-01T00:00:00Z/2022-01-02T00:00:00Z",
// Date-only
"2022-01-01/2022-01-02",
// start/period
"2022-01-01T12:00:00Z/PT6H",
// period/end
"P2DT3H4M5S/2022-01-01T00:00:00Z"
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]