Class StringFunctionHelpers
java.lang.Object
org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longstatic StringgetStringFromVarCharHolder(NullableVarCharHolder varCharHolder) Convert a NullableVarCharHolder to a String.static StringgetStringFromVarCharHolder(VarCharHolder varCharHolder) Convert a VarCharHolder to a String.static StringCapitalizes first letter in each word.static booleanisReadableAsDate(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 StringtoStringFromUTF16(int start, int end, DrillBuf buffer) static StringtoStringFromUTF8(int start, int end, DrillBuf buffer) static intvarTypesToInt(int start, int end, DrillBuf buffer) static longvarTypesToLong(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
-