Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-41279 Feature parity: DataFrame API in Spark Connect
  3. SPARK-41897

Parity in Error types between pyspark and connect functions

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • Connect
    • None

    Description

      PySpark throws Py4JJavaError where as connect throws SparkConnectException

      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()
      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 

      Attachments

        Activity

          People

            techaddict Sandeep Singh
            techaddict Sandeep Singh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: