reallocf commented on a change in pull request #5326:
URL: https://github.com/apache/incubator-pinot/pull/5326#discussion_r422551022



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/function/DateTimeFunctions.java
##########
@@ -40,4 +47,14 @@ static Long toEpochHours(Long millis) {
   static Long toEpochMinutes(Long millis, String bucket) {
     return TimeUnit.MILLISECONDS.toMinutes(millis) / Integer.parseInt(bucket);
   }
+
+  DateTime toDateTime(String dateTimeString, String pattern) {
+    if (!_dateTimeFormatterMap.containsKey(pattern)) {
+      _dateTimeFormatterMap.put(pattern, DateTimeFormat.forPattern(pattern));
+    }
+
+    DateTimeFormatter dateTimeFormatter = _dateTimeFormatterMap.get(pattern);
+
+    return dateTimeFormatter.parseDateTime(dateTimeString);

Review comment:
       Okay, adjusted this so toDateTime takes in a Long millis and returns a 
String formattedDateTime and fromDateTime takes in a String formattedDateTime 
and outputs a Long millis - does that seem right to you?




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to