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.
UDF Name
input dataframe
spark session
columns to be used as keys in lookup functions.
schema of entire row which will be stored for each matching key.
registered UDF definitions for lookup functions. These UDF functions returns different results depending on the lookup function.
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.
created UDF name
input dataframe
spark session
column whose value to be considered as minimum in comparison.
column whose value to be considered as maximum in comparison.
remaining column names to be part of result.
registers UDF which in turn returns rows corresponding to each row in dataframe on which range UDF is called.
By default returns only the first matching record
Returns the last matching record
Boolean Column
(Since version ) see corresponding Javadoc for more information.