VeloDB Cloud 26.x·Apache Doris 4.x (up to 4.0 supported)·"Since X.Y" tags refer to Apache Doris versionsVersion mapping
PROTOCOL
Description
The PROTOCOL function is mainly used to extract the protocol part from a URL string.
Syntax
PROTOCOL( <url> )
Parameters
| Parameter | Description |
|---|---|
<url> | The URL to be parsed |
Return Value
Returns the protocol part of the
- If any of the parameters is NULL, NULL is returned.
Examples
SELECT protocol('https://doris.apache.org/');
+---------------------------------------+
| protocol('https://doris.apache.org/') |
+---------------------------------------+
| https |
+---------------------------------------+
SELECT protocol(null);
+----------------+
| protocol(NULL) |
+----------------+
| NULL |
+----------------+
See Also
If you want to extract other parts of the URL, you can use parse_url.