url_decode-functie

Van toepassing op:vinkje als ja aan Databricks SQL vinkje als ja aan Databricks Runtime 11.3 LTS en hoger

Hiermee wordt een tekenreeks terug vertaald uit de indeling x-www-form-urlencoded .

Syntaxis

url_decode(str)

Argumenten

  • str: een TEKENREEKS-expressie om te decoderen.

Retouren

EEN TEKENREEKS.

Als de tekenreeks niet voldoet aan de indeling application/x-www-form-urlencoded , retourneert de functie en de fout.

Voorbeelden

> SELECT url_encode('http://spark.apache.org/path?query=1');
 http%3A%2F%2Fspark.apache.org%2Fpath%3Fquery%3D1

> SELECT url_decode('http%3A%2F%2Fspark.apache.org%2Fpath%3Fquery%3D1');
 http://spark.apache.org/path?query=1

> SELECT url_decode('http%3A%2F%2spark.apache.org');
 Error: Illegal argument

> SELECT parse_url('http://spark.apache.org/path?query=1', 'QUERY', 'query');
 1

> SELECT parse_url('http%3A%2F%2Fspark.apache.org%2Fpath%3Fquery%3D1', 'QUERY', 'query');
 1