Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-16062

PySpark SQL python-only UDTs don't work well

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.1, 2.1.0
    • SQL
    • None

    Description

      Python-only UDTs can't work well. One example is:

      import pyspark.sql.group
      from pyspark.sql.tests import PythonOnlyPoint, PythonOnlyUDT
      from pyspark.sql.types import *
      
      schema = StructType().add("key", LongType()).add("val", PythonOnlyUDT())
      df = spark.createDataFrame([(i % 3, PythonOnlyPoint(float(i), float(i))) for i in range(10)], schema=schema)
      
      df.collect()  # this works
      df.show() # this doesn't work
      

      Attachments

        Issue Links

          Activity

            People

              viirya L. C. Hsieh
              viirya L. C. Hsieh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: