You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2023/01/07 23:11:00 UTC

[jira] [Commented] (SPARK-41897) Parity in Error types between pyspark and connect functions

    [ https://issues.apache.org/jira/browse/SPARK-41897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655741#comment-17655741 ] 

Apache Spark commented on SPARK-41897:
--------------------------------------

User 'techaddict' has created a pull request for this issue:
https://github.com/apache/spark/pull/39450

> Parity in Error types between pyspark and connect functions
> -----------------------------------------------------------
>
>                 Key: SPARK-41897
>                 URL: https://issues.apache.org/jira/browse/SPARK-41897
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Connect
>    Affects Versions: 3.4.0
>            Reporter: Sandeep Singh
>            Priority: Major
>
> PySpark throws Py4JJavaError where as connect throws SparkConnectException
> {code:java}
> from pyspark.sql.functions import assert_true
> df = self.spark.range(3)
> self.assertEqual(
>     df.select(assert_true(df.id < 3)).toDF("val").collect(),
>     [Row(val=None), Row(val=None), Row(val=None)],
> )
> with self.assertRaises(Py4JJavaError) as cm:
>     df.select(assert_true(df.id < 2, "too big")).toDF("val").collect(){code}
> {code:java}
> Traceback (most recent call last):
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/tests/test_functions.py", line 950, in test_assert_true
>     df.select(assert_true(df.id < 2, "too big")).toDF("val").collect()
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", line 1076, in collect
>     table = self._session.client.to_table(query)
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/client.py", line 414, in to_table
>     table, _ = self._execute_and_fetch(req)
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/client.py", line 586, in _execute_and_fetch
>     self._handle_error(rpc_error)
>   File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/client.py", line 629, in _handle_error
>     raise SparkConnectException(status.message, info.reason) from None
> pyspark.sql.connect.client.SparkConnectException: (java.lang.RuntimeException) too big {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org