Syntax
Scalar
Arguments
Returns
- Type: BOOLEAN
- Possible values: TRUE or FALSE from a case-sensitive literal substring comparison.
- NULL behavior: Returns NULL if either argument is NULL.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Tests whether a string contains another string.
contains_substr(value, search)
| Name | Type | Required | Description |
|---|---|---|---|
| value | STRING | Yes | The string to inspect. |
| search | STRING | Yes | The substring to find. |
| Property | Value |
|---|---|
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |
SELECT contains_substr('abc', 'b') AS found, contains_substr('abc', '') AS empty_search;
| found | empty_search |
|---|---|
| true | true |
SELECT contains_substr('Spark SQL', 'SQL') AS same_case, contains_substr('Spark SQL', 'sql') AS different_case;
| same_case | different_case |
|---|---|
| true | false |