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

Implement DataFrame.explain format to be similar to PySpark

    XMLWordPrintableJSON

Details

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

    Description

      df = spark.createDataFrame([(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) 
      df.explain()
      df.explain(True)
      df.explain(mode="formatted")
      df.explain("cost")
      File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", line 1296, in pyspark.sql.connect.dataframe.DataFrame.explain
      Failed example:
          df.explain()
      Expected:
          == Physical Plan ==
          *(1) Scan ExistingRDD[age...,name...]
      Got:
          == Physical Plan ==
          LocalTableScan [age#1148L, name#1149]
          <BLANKLINE>
          <BLANKLINE>
      **********************************************************************
      File "/Users/s.singh/personal/spark-oss/python/pyspark/sql/connect/dataframe.py", line 1314, in pyspark.sql.connect.dataframe.DataFrame.explain
      Failed example:
          df.explain(mode="formatted")
      Expected:
          == Physical Plan ==
          * Scan ExistingRDD (...)
          (1) Scan ExistingRDD [codegen id : ...]
          Output [2]: [age..., name...]
          ...
      Got:
          == Physical Plan ==
          LocalTableScan (1)
          <BLANKLINE>
          <BLANKLINE>
          (1) LocalTableScan
          Output [2]: [age#1170L, name#1171]
          Arguments: [age#1170L, name#1171]
          <BLANKLINE>
          <BLANKLINE>

      Attachments

        Issue Links

          Activity

            People

              beliefer Jiaan Geng
              techaddict Sandeep Singh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: