Note
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Throws an exception with the provided error message.
Syntax
from pyspark.sql import functions as sf
sf.raise_error(errMsg)
Parameters
| Parameter | Type | Description |
|---|---|---|
errMsg |
pyspark.sql.Column or str |
A Python string literal or column containing the error message. |
Returns
pyspark.sql.Column: throws an error with specified message.
Examples
Example 1: Raise a custom error message
from pyspark.sql import functions as sf
spark.range(1).select(sf.raise_error("My error message")).show()
java.lang.RuntimeException: My error message