Função url_encode

Aplica-se a:Marque Sim Databricks SQL Marque Sim Databricks Runtime 11.3 LTS e superior

Traduz uma cadeia de caracteres para o formato application/x-www-form-urlencoded .

Sintaxe

url_encode(str)

Argumentos

  • str: Uma expressão STRING para codificar.

Devoluções

Um STRING compatível com o formato application/x-www-form-urlencoded (www.w3.org ):

Exemplos

> 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(url_decode('http%3A%2F%2Fspark.apache.org%2Fpath%3Fquery%3D1'), 'HOST');
 1