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

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: PySpark, SQL
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: