Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-19159 PySpark UDF API improvements
  3. SPARK-19427

UserDefinedFunction should support data types strings

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.1.0
    • 2.2.0
    • PySpark, SQL
    • None

    Description

      PySpark SQL supports casting using data type strings.

      from pyspark.sql.functions import col
      
      col("foo").cast("integer")
      

      It should be possible to do the same with udf / UserDefinedFunction:

      from pyspark.sql import udf
      
      udf(lambda x: x + 1, "integer")
      

      Attachments

        Activity

          People

            zero323 Maciej Szymkiewicz
            zero323 Maciej Szymkiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: