The PROTOCOL function is mainly used to extract the protocol part from a URL string.
PROTOCOL( <url> )
| Parameter | Description |
|---|---|
<url> | The URL to be parsed |
Returns the protocol part of the . Special cases:
SELECT protocol('https://doris.apache.org/');
+---------------------------------------+ | protocol('https://doris.apache.org/') | +---------------------------------------+ | https | +---------------------------------------+
SELECT protocol(null);
+----------------+ | protocol(NULL) | +----------------+ | NULL | +----------------+
If you want to extract other parts of the URL, you can use parse_url。