Class CharSubstring

java.lang.Object
org.apache.drill.exec.expr.fn.impl.CharSubstring
All Implemented Interfaces:
DrillFunc, DrillSimpleFunc

public class CharSubstring extends Object implements DrillSimpleFunc
Evaluate a substring expression for a given UTF-8 value; specifying the start position, and optionally the end position. - If the start position is negative, start from abs(start) characters from the end of the buffer. - If no length is specified, continue to the end of the string. - If the substring expression's length exceeds the value's upward bound, the value's length will be used. - If the substring is invalid, return an empty string. - NOTE: UTF-8 values range from 1 to 4 bytes per character, thus searching for the start, length, and negative length may result in 3 partial scans of the UTF-8 string. - TODO: implement optional length parameter
  • Constructor Details

    • CharSubstring

      public CharSubstring()
  • Method Details