Aracılığıyla paylaş


url_encode işlevi

Şunlar için geçerlidir: onay işareti evet olarak işaretlenmiş Databricks SQL onay işareti evet olarak işaretlenmiş Databricks Runtime 11.3 LTS ve üzeri

Bir dizeyi application/x-www-form-urlencoded biçimine çevirir.

Söz dizimi

url_encode(str)

Bağımsız değişkenler

  • str: Kodlanacak STRING ifadesi.

Döndürülenler

STRING Application/x-www-form-urlencoded (www.w3.org) biçimiyle uyumlu:

Örnekler

> 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