Class StringFunctionHelpers
java.lang.Object
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
static String
getStringFromVarCharHolder
(NullableVarCharHolder varCharHolder) Convert a NullableVarCharHolder to a String.static String
getStringFromVarCharHolder
(VarCharHolder varCharHolder) Convert a VarCharHolder to a String.static String
Capitalizes first letter in each word.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.static String
toStringFromUTF16
(int start, int end, DrillBuf buffer) static String
toStringFromUTF8
(int start, int end, DrillBuf buffer) static int
varTypesToInt
(int start, int end, DrillBuf buffer) static long
varTypesToLong
(int start, int end, DrillBuf buffer)
-
Constructor Details
-
StringFunctionHelpers
public StringFunctionHelpers()
-
-
Method Details
-
varTypesToLong
-
varTypesToInt
-
initCap
Capitalizes first letter in each word. Any symbol except digits and letters is considered as word delimiter.- Parameters:
source
- input characters
-
getStringFromVarCharHolder
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
Convert a NullableVarCharHolder to a String. -
toStringFromUTF8
-
toStringFromUTF16
-
getDate
-
isReadableAsDate
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
-