Hyukjin Kwon created SPARK-61123:
------------------------------------
Summary: Take a Python Enum as the literal of its value in lit,
Column operators and functions, in the Python client as PySpark does
Key: SPARK-61123
URL: https://issues.apache.org/jira/browse/SPARK-61123
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
PySpark takes a Python {{Enum}} as a literal of its value
({{pyspark.sql.utils.enum_to_value}}): {{lit(IntEnum.X)}}, {{col("id") +
IntEnum.X}}, {{col("id") == IntEnum.X}}, {{col("b") & BoolEnum.T}},
{{col("s").contains(StrEnum.S)}}, {{col("id").isin(IntEnum.X)}}, {{between}},
{{bitwiseOR}}, {{F.pow(col, IntEnum.X)}}, {{F.concat_ws(StrEnum.S, ...)}} and
the other operators and functions that take a value. Apache Spark's
{{test_enum_literals}} of {{test_column.py}} checks them.
The Python client raises {{PySparkTypeError: [UNSUPPORTED_DATA_TYPE]
Unsupported DataType `IntEnum`}} for all of them, except {{substr}}.
The fix is to take an Enum as the literal of its value, as PySpark does.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]