- Apache Pig Environment
- Apache Pig - Installation
- Apache Pig - Execution
- Apache Pig - Grunt Shell
- Pig Latin
- Pig Latin - Basics
- Load & Store Operators
- Apache Pig - Reading Data
- Apache Pig - Storing Data
- Diagnostic Operators
- Apache Pig - Diagnostic Operator
- Apache Pig - Describe Operator
- Apache Pig - Explain Operator
- Apache Pig - Illustrate Operator
- Grouping & Joining
- Apache Pig - Group Operator
- Apache Pig - Cogroup Operator
- Apache Pig - Join Operator
- Apache Pig - Cross Operator
- Combining & Splitting
- Apache Pig - Union Operator
- Apache Pig - Split Operator
- Pig Latin Built-In Functions
- Apache Pig - Eval Functions
- Load & Store Functions
- Apache Pig - Bag & Tuple Functions
- Apache Pig - String Functions
- Apache Pig - date-time Functions
- Apache Pig - Math Functions
- Other Modes Of Execution
- Apache Pig - User-Defined Functions
- Apache Pig - Running Scripts
- Apache Pig Useful Resources
- Apache Pig - Quick Guide
- Apache Pig - Useful Resources
- Apache Pig - Discussion
Apache Pig - String Functions
We have the following String functions in Apache Pig.
| S.N. | Functions & Description |
|---|---|
| 1 |
ENDSWITH(string, testAgainst)
To verify whether a given string ends with a particular substring. |
| 2 |
STARTSWITH(string, substring)
Accepts two string parameters and verifies whether the first string starts with the second. |
| 3 |
SUBSTRING(string, startIndex, stopIndex)
Returns a substring from a given string. |
| 4 |
EqualsIgnoreCase(string1, string2)
To compare two stings ignoring the case. |
| 5 |
INDEXOF(string, character, startIndex)
Returns the first occurrence of a character in a string, searching forward from a start index. |
| 6 |
LAST_INDEX_OF(expression)
Returns the index of the last occurrence of a character in a string, searching backward from a start index. |
| 7 |
LCFIRST(expression)
Converts the first character in a string to lower case. |
| 8 |
UCFIRST(expression)
Returns a string with the first character converted to upper case. |
| 9 |
UPPER(expression)
UPPER(expression) Returns a string converted to upper case. |
| 10 |
LOWER(expression)
Converts all characters in a string to lower case. |
| 11 |
REPLACE(string, oldChar, newChar);
To replace existing characters in a string with new characters. |
| 12 |
STRSPLIT(string, regex, limit)
To split a string around matches of a given regular expression. |
| 13 |
STRSPLITTOBAG(string, regex, limit)
Similar to the STRSPLIT() function, it splits the string by given delimiter and returns the result in a bag. |
| 14 |
TRIM(expression)
Returns a copy of a string with leading and trailing whitespaces removed. |
| 15 |
LTRIM(expression)
Returns a copy of a string with leading whitespaces removed. |
| 16 |
RTRIM(expression)
Returns a copy of a string with trailing whitespaces removed. |