Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Returns the input value if it corresponds to a valid UTF-8 string, or NULL otherwise.
For the corresponding Databricks SQL function, see try_validate_utf8 function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.try_validate_utf8(str=<str>)
Parameters
| Parameter | Type | Description |
|---|---|---|
str |
pyspark.sql.Column or str |
A column of strings, each representing a UTF-8 byte sequence. |
Returns
pyspark.sql.Column: the input string if it is a valid UTF-8 string, null otherwise.
Examples
from pyspark.databricks.sql import functions as dbf
spark.range(1).select(dbf.try_validate_utf8(dbf.lit("SparkSQL"))).show()