For the complete documentation index, see llms.txt. This page is also available as Markdown.

splitPart

This section contains reference documentation for the splitPart function.

Splits the input string by a delimiter and returns one element from the result.

Pinot supports both splitPart(str, delimiter, index) and splitPart(str, delimiter, limit, index). The snake-case alias split_part(...) is also accepted. The index is 0-based. Negative indices count from the end of the split result.

Signature

splitPart(str, delimiter, index)
splitPart(str, delimiter, limit, index)

Parameters

  • str: Input string to split.

  • delimiter: Delimiter used to split the string.

  • index: 0-based element index. Negative values count from the end.

  • limit: Optional split limit applied before selecting the element.

Returns

Returns the selected string element. If the index is out of bounds, Pinot returns the string literal "null".

Usage examples

These examples are derived from StringFunctionsTest.

Returns:

Returns:

Returns:

Notes

  • The 4-argument form applies the split limit first and then looks up the requested index.

  • Multi-character delimiters are supported.

  • Empty input strings return "null" when the delimiter is non-empty.

Last updated

Was this helpful?