Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
Returns true if the input is a valid UTF-8 string, otherwise returns false.
For the corresponding Databricks SQL function, see is_valid_utf8 function.
Syntax
from pyspark.sql import functions as dbf
dbf.is_valid_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: whether the input string is a valid UTF-8 string.
Examples
from pyspark.sql import functions as dbf
spark.range(1).select(dbf.is_valid_utf8(dbf.lit("SparkSQL"))).show()