Class DateUtilFunctions

java.lang.Object
org.apache.drill.exec.udfs.DateUtilFunctions

public class DateUtilFunctions extends Object
  • Constructor Details

    • DateUtilFunctions

      public DateUtilFunctions()
  • Method Details

    • getDateFromString

      public static LocalDate getDateFromString(String inputString)
      Parses common date strings and returns a LocalDate of that string. If the method is unable to parse the string, an error will be logged. Supports the following formats:
      • yyyy-MM-dd
      • MM/dd/yyyy
      • M/d/yyyy
      • yyyy/MM/dd
      Parameters:
      inputString - An input string containing a date.
      Returns:
      A LocalDate of the input string.
    • getDateFromString

      public static LocalDate getDateFromString(String inputString, boolean leadingDay)
      Parses common date strings and returns a LocalDate of that string. If the method is unable to parse the string, an error will be logged. Supports the following formats:
      • yyyy-MM-dd
      • MM/dd/yyyy
      • dd/MM/yyyy
      • M/d/yyyy
      • yyyy/MM/dd
      If the matcher is unable to convert the string, the function returns null.
      Parameters:
      inputString - An input string containing a date.
      leadingDay - True if the format has the day first.
      Returns:
      A LocalDate of the input string.
    • getTimestampFromString

      public static LocalDateTime getTimestampFromString(String inputString)