Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Component/s: PySpark
    • Labels:
      None

      Description

      from pyspark.sql.functions import pandas_udf
      from pyspark.sql.functions import col, lit
      from pyspark.sql.types import LongType
      df = spark.range(3)
      f = pandas_udf(lambda x, y: len(x) + y, LongType())
      df.select(f(lit('text'), col('id'))).show()
      
      from pyspark.sql.functions import udf
      from pyspark.sql.functions import col, lit
      from pyspark.sql.types import LongType
      df = spark.range(3)
      f = udf(lambda x, y: len(x) + y, LongType())
      df.select(f(lit('text'), col('id'))).show()
      

      The results of pandas_udf are different from udf.

        Attachments

          Activity

            People

            • Assignee:
              hyukjin.kwon Hyukjin Kwon
              Reporter:
              smilegator Xiao Li
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: