Package org.apache.drill.exec.udfs
Class DateConversionUtils
java.lang.Object
org.apache.drill.exec.udfs.DateConversionUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static enum
Specifies the time grouping to be used with the nearest date function -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final LocalDateTime
getDate
(LocalDateTime d, String interval) This function takes a Java LocalDateTime object, and an interval string and returns the nearest date closets to that time.
-
Constructor Details
-
DateConversionUtils
public DateConversionUtils()
-
-
Method Details
-
getDate
This function takes a Java LocalDateTime object, and an interval string and returns the nearest date closets to that time. For instance, if you specified the date as 2018-05-04 and YEAR, the function will return 2018-01-01- Parameters:
d
- the original datetime before adjustmentsinterval
- The interval string to deduct from the supplied date- Returns:
- the modified LocalDateTime
-