Object

io.prophecy.libs.python

UDFUtils

Related Doc: package python

Permalink

object UDFUtils

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UDFUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def call_udf(udfName: String, cols: Seq[Column]): Column

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  7. def createLookup(name: String, df: DataFrame, spark: SparkSession, keyCols: List[String], rowCols: List[String]): UserDefinedFunction

    Permalink

    Function registers 4 different UDFs with spark registry.

    Function registers 4 different UDFs with spark registry. UDF for lookup_match, lookup_count, lookup_row and lookup functions are registered. This function stores the data of input dataframe in a broadcast variable, then uses this broadcast variable in different lookup functions.

    lookup : This function returns the first matching row for given input keys lookup_count : This function returns the count of all matching rows for given input keys. lookup_match : This function returns 0 if there is no matching row and 1 for some matching rows for given input keys. lookup_row : This function returns all the matching rows for given input keys.

    This function registers for upto 10 matching keys as input to these lookup functions.

    name

    UDF Name

    df

    input dataframe

    spark

    spark session

    keyCols

    columns to be used as keys in lookup functions.

    rowCols

    schema of entire row which will be stored for each matching key.

    returns

    registered UDF definitions for lookup functions. These UDF functions returns different results depending on the lookup function.

  8. def createRangeLookup(name: String, df: DataFrame, spark: SparkSession, minColumn: String, maxColumn: String, valueColumns: List[String]): UserDefinedFunction

    Permalink

    Method to create UDF which looks for passed input double in input dataframe.

    Method to create UDF which looks for passed input double in input dataframe. This function first loads the data of dataframe in broadcast variable and then defines a UDF which looks for input double value in the data stored in broadcast variable. If input double lies between passed col1 and col2 values then it adds corresponding row in the returned result. If value of input double doesn't lie between col1 and col2 then it simply returns null for current row in result.

    name

    created UDF name

    df

    input dataframe

    spark

    spark session

    minColumn

    column whose value to be considered as minimum in comparison.

    maxColumn

    column whose value to be considered as maximum in comparison.

    valueColumns

    remaining column names to be part of result.

    returns

    registers UDF which in turn returns rows corresponding to each row in dataframe on which range UDF is called.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def lookup(lookupName: String, cols: List[Column]): Column

    Permalink

    By default returns only the first matching record

  15. def lookup_count(lookupName: String, cols: List[Column]): Column

    Permalink
  16. def lookup_last(lookupName: String, cols: List[Column]): Column

    Permalink

    Returns the last matching record

  17. def lookup_match(lookupName: String, cols: List[Column]): Column

    Permalink

    returns

    Boolean Column

  18. def lookup_nth(lookupName: String, cols: List[Column]): Column

    Permalink
  19. def lookup_row(lookupName: String, cols: List[Column]): Column

    Permalink
  20. def lookup_row_reverse(lookupName: String, cols: List[Column]): Column

    Permalink
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped