Presto 0.100 Documentation

5.11. URL函数

4.11. URL函数

URL方法用于从HTTP URLs(或者是任何满足RFC 2396标准的有效URIs)中提取相应的信息。URL方法支持如下的语法:

[protocol:][//host[:port]][path][?query][#fragment]

被从URLs中提取出来的部分,不会包括URI的语法分隔符(如:或者?

url_extract_fragment(url) → varchar

Returns the fragment identifier from url.

url_extract_host(url) → varchar

Returns the host from url.

url_extract_parameter(url, name) → varchar

Returns the value of the first query string parameter named name from url. Parameter extraction is handled in the typical manner as specified by RFC 1866.

url_extract_path(url) → varchar

Returns the path from url.

url_extract_port(url) → bigint

Returns the port number from url.

url_extract_protocol(url) → varchar

Returns the protocol from url.

url_extract_query(url) → varchar

Returns the query string from url.