Split a dot-separated qualified SQL identifier into its component parts.
PARSE_IDENT(str)
## Overview Splits a dot-separated qualified SQL identifier into an array of its component parts. Quoted segments (enclosed in double quotes) are preserved with their original case and may contain special characters, spaces, and punctuation. Unquoted segments are folded to lowercase, following the standard SQL identifier rules. PARSE_IDENT is useful when programmatically decomposing multi-part object references such as catalog.schema.table, when building dynamic SQL that needs to inspect the target object, or when pulling the bare table name out of an otherwise qualified reference. ## Behavior - Returns NULL when the input is NULL. - Returns an array of STRING elements, one per component. - Unquoted segments are lower-cased. - Quoted segments keep their original case and may contain any character except an unescaped double quote. - Embedded double quotes within a quoted segment are represented as two consecutive double quotes. - Raises an error on malformed input such as unbalanced quotes or stray dots. - Operates on Unicode code points. ## Compatibility - Matches the common SQL PARSE_IDENT semantics.
| Name | Type | Description |
|---|---|---|
str | Specifies the dot-separated qualified SQL identifier to parse. Supports quoted identifiers using double quotes. |
-- Two-part identifier
SELECT PARSE_IDENT('schema.table'); -- ['schema', 'table']
-- Three-part identifier
SELECT PARSE_IDENT('catalog.schema.table'); -- ['catalog', 'schema', 'table']
-- Quoted segments preserve case and special characters
SELECT PARSE_IDENT('"my schema"."my table"'); -- ['my schema', 'my table']
-- Single identifier
SELECT PARSE_IDENT('users'); -- ['users']
-- NULL propagates
SELECT PARSE_IDENT(CAST(NULL AS VARCHAR)); -- NULL
-- Unquoted identifiers are lower-cased per SQL rules
SELECT PARSE_IDENT('Schema.Table'); -- ['schema', 'table']