Napomena
Za pristup ovoj stranici potrebna je autorizacija. Možete se pokušati prijaviti ili promijeniti direktorije.
Za pristup ovoj stranici potrebna je autorizacija. Možete pokušati promijeniti direktorije.
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