Class StringFunctionHelpers

java.lang.Object
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers

public class StringFunctionHelpers extends Object
  • Constructor Details

    • StringFunctionHelpers

      public StringFunctionHelpers()
  • Method Details

    • varTypesToLong

      public static long varTypesToLong(int start, int end, DrillBuf buffer)
    • varTypesToInt

      public static int varTypesToInt(int start, int end, DrillBuf buffer)
    • initCap

      public static String initCap(String source)
      Capitalizes first letter in each word. Any symbol except digits and letters is considered as word delimiter.
      Parameters:
      source - input characters
    • getStringFromVarCharHolder

      public static String getStringFromVarCharHolder(VarCharHolder varCharHolder)
      Convert a VarCharHolder to a String. VarCharHolders are designed specifically for object reuse and mutability, only use this method when absolutely necessary for interacting with interfaces that must take a String.
      Parameters:
      varCharHolder - a mutable wrapper object that stores a variable length char array, always in UTF-8
      Returns:
      String of the bytes interpreted as UTF-8
    • getStringFromVarCharHolder

      public static String getStringFromVarCharHolder(NullableVarCharHolder varCharHolder)
      Convert a NullableVarCharHolder to a String.
    • toStringFromUTF8

      public static String toStringFromUTF8(int start, int end, DrillBuf buffer)
    • toStringFromUTF16

      public static String toStringFromUTF16(int start, int end, DrillBuf buffer)
    • getDate

      public static long getDate(DrillBuf buf, int start, int end)
    • isReadableAsDate

      public static boolean isReadableAsDate(DrillBuf buf, int start, int end)
      Takes a string value, specified as a buffer with a start and end and returns true if the value can be read as a date.
      Parameters:
      buf -
      start -
      end -
      Returns:
      true iff the string value can be read as a date