Apache Tajo - String Functions


The following table lists out the string functions in Tajo.

S.No. Function & Description
1 concat(string1, ..., stringN)

Concatenate the given strings.

2 length(string)

Returns the length of the given string.

3 lower(string)

Returns the lowercase format for the string.

4 upper(string)

Returns the uppercase format for the given string.

5 ascii(string text)

Returns the ASCII code of the first character of the text.

6 bit_length(string text)

Returns the number of bits in a string.

7 char_length(string text)

Returns the number of characters in a string.

8 octet_length(string text)

Returns the number of bytes in a string.

9 digest(input text, method text)

Calculates the Digest hash of string. Here, the second arg method refers to the hash method.

10 initcap(string text)

Converts the first letter of each word to upper case.

11 md5(string text)

Calculates the MD5 hash of string.

12 left(string text, int size)

Returns the first n characters in the string.

13 right(string text, int size)

Returns the last n characters in the string.

14 locate(source text, target text, start_index)

Returns the location of specified substring.

15 strposb(source text, target text)

Returns the binary location of specified substring.

16 substr(source text, start index, length)

Returns the substring for the specified length.

17 trim(string text[, characters text])

Removes the characters (a space by default) from the start/end/both ends of the string.

18 split_part(string text, delimiter text, field int)

Splits a string on delimiter and returns the given field (counting from one).

19 regexp_replace(string text, pattern text, replacement text)

Replaces substrings matched to a given regular expression pattern.

20 reverse(string)

Reverse operation performed for the string.