EXTRACT_URL_PARAMETER
Descriptionβ
Returns the value of the name
parameter in the URL, if it exists, or an empty string otherwise.
If there are multiple parameters with this name, the first one that occurs is returned.
This function works assuming that the parameter name is encoded in the URL exactly as it is in the passed parameter.
If you want to get other parts of the URL, you can use parse_url
Syntaxβ
EXTRACT_URL_PARAMETER ( <url> , <name> )
Parametersβ
Parameters | Description |
---|---|
<url> | The url string of the parameter to be returned |
<name> | The name of the parameter to be returned |
Return Valueβ
The value of the parameter <name>
in <url>
Exampleβ
SELECT EXTRACT_URL_PARAMETER("http://doris.apache.org?k1=aa&k2=bb&test=cc#999", "k2")
+--------------------------------------------------------------------------------+
| extract_url_parameter('http://doris.apache.org?k1=aa&k2=bb&test=cc#999', 'k2') |
+--------------------------------------------------------------------------------+
| bb |
+--------------------------------------------------------------------------------+