You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2022/11/18 12:01:08 UTC

[GitHub] [drill] jnturton commented on a diff in pull request #2689: DRILL-8340: Add Additional Date Manipulation Functions

jnturton commented on code in PR #2689:
URL: https://github.com/apache/drill/pull/2689#discussion_r1026354128


##########
contrib/udfs/src/main/java/org/apache/drill/exec/udfs/DateFunctions.java:
##########
@@ -140,8 +142,36 @@ public void eval() {
       java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern(format);
       java.time.LocalDateTime dateTime = java.time.LocalDateTime.parse(inputDate, formatter);
 
-      java.time.LocalDateTime td = org.apache.drill.exec.udfs.NearestDateUtils.getDate(dateTime, intervalString);
+      java.time.LocalDateTime td = DateConversionUtils.getDate(dateTime, intervalString);
       out.value = td.atZone(java.time.ZoneId.of("UTC")).toInstant().toEpochMilli();
     }
   }
+
+  @FunctionTemplate(names = {"to_timestamp"},

Review Comment:
   Please add a comment explaining that this function differs from the other `to_timestamp` functions in that it takes no timestamp format argument and will try to determine one automatically.



-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org