Share via


Funzione url_decode

Si applica a:segno di spunta sì Databricks SQL segno di spunta sì Databricks Runtime 11.3 LTS e versioni successive

Converte di nuovo una stringa dal formato application/x-www-form-urlencoded .

Sintassi

url_decode(str)

Argomenti

  • str: espressione STRING da decodificare.

Valori restituiti

STRINGA.

Se la stringa non è conforme al formato application/x-www-form-urlencoded , la funzione restituisce e restituisce un errore.

Esempi

> 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