richardstartin commented on a change in pull request #8118:
URL: https://github.com/apache/pinot/pull/8118#discussion_r798853342
##########
File path:
pinot-spi/src/main/java/org/apache/pinot/spi/utils/TimestampUtils.java
##########
@@ -60,8 +67,30 @@ public static long toMillisSinceEpoch(String
timestampString) {
try {
return Long.parseLong(timestampString);
} catch (Exception e1) {
- throw new IllegalArgumentException(String.format("Invalid timestamp:
'%s'", timestampString));
+ try {
+ return dateTimeToTimestamp(timestampString).getTime();
+ } catch (Exception e2) {
+ throw new IllegalArgumentException(String.format("Invalid timestamp:
'%s'", timestampString));
+ }
+ }
+ }
+ }
+
+ /**
+ * Infers a date time format from a valid {@link Timestamp} string.
+ */
+ private static Timestamp dateTimeToTimestamp(String timestampString) {
Review comment:
This will get called a lot on the critical path, so the point about
`java.time` vs SDF is important.
--
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]