pyspark.sql.functions.octet_length¶
-
pyspark.sql.functions.
octet_length
(col: ColumnOrName) → pyspark.sql.column.Column¶ Calculates the byte length for the specified string column.
Examples
>>> from pyspark.sql.functions import octet_length >>> spark.createDataFrame([('cat',), ( '🐈',)], ['cat']) \ ... .select(octet_length('cat')).collect() [Row(octet_length(cat)=3), Row(octet_length(cat)=4)]