Trait/Object

io.prophecy.libs

SparkFunctions

Related Docs: object SparkFunctions | package libs

Permalink

trait SparkFunctions extends AnyRef

Library of all spark functions which implements different abinitio functions used in abinitio workflows.

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

Type Members

  1. class StringAsStream extends Serializable

    Permalink

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. val Calculate_TAT_Hours_Udf: UserDefinedFunction

    Permalink
  5. val Get_Clean_Date_Local_Udf: UserDefinedFunction

    Permalink
  6. val Get_Holiday_Cnt_Diff_Value: UserDefinedFunction

    Permalink
  7. val Get_Holiday_Cnt_Values: UserDefinedFunction

    Permalink
  8. val Get_Ship_Date_Local_Udf: UserDefinedFunction

    Permalink
  9. val Get_V_Final_Days_To_Ship_Udf: UserDefinedFunction

    Permalink
  10. val Get_V_Final_Tat_Hours_Udf: UserDefinedFunction

    Permalink
  11. val Get_full_day_of_week_from_number: UserDefinedFunction

    Permalink
  12. object LongSequence

    Permalink
  13. val Weekend_Day_Cnt_Inner: UserDefinedFunction

    Permalink
  14. def YJJJ_to_YYYYJJJ(in_date: Column, ref_date: Column): Column

    Permalink

    Converts 1 digit julian year to 4 digits julian year.

    Converts 1 digit julian year to 4 digits julian year.

    in_date

    date in Julian in "YJJJ" format

    ref_date

    date in "yyyyMMdd" format

    returns

    a date in "YYYYJJJ"

  15. val adjustCenturyDateInCyyFormat: UserDefinedFunction

    Permalink

    begining of input should have Cyy

  16. def adjustStringRegexPattern(input: String): String

    Permalink
  17. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  18. val bigDecimalToPackedBytes: UserDefinedFunction

    Permalink
  19. val canonical_representation: UserDefinedFunction

    Permalink
  20. val char_string: UserDefinedFunction

    Permalink
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  22. def convertInputBytesToStructType(input: Any, typeInfo: Seq[String], startByte: Int = 0): Row

    Permalink

    Method used for abinitio's reinterpret_as function to read necessary bytes from byteArray for input data and convert into struct format as per provided in typeInfo sequence.

    Method used for abinitio's reinterpret_as function to read necessary bytes from byteArray for input data and convert into struct format as per provided in typeInfo sequence.

    TypeInfo can have multiple entries, each could be either decimal or string type. Depending on the argument passed within decimal or string bytes are read from input byte array.

    If decimal or string argument has some integer then that many bytes are read from input byte array or if decimal or string has some string delimiter as its argument then from the current position bytes are read until string delimiter is found in input byte array.

  23. def createDataFrameFromData(inputData: String, delimiter: String, columnName: String, columnType: String, sparkSession: SparkSession): DataFrame

    Permalink

    Method to read values from inputData and create dataframe with column name as columnName and column type as columnType for the values in inputData delimiter by delimiter.

  24. val cross_join_index_range: UserDefinedFunction

    Permalink
  25. def date_add_months(inputDate: Column, months: Int): Column

    Permalink

    Returns the internal representation of a date resulting from adding (or subtracting) a number of months to the specified date.

    Returns the internal representation of a date resulting from adding (or subtracting) a number of months to the specified date.

    inputDate

    in yyyy-MM-dd format

  26. def date_difference_days(laterDate: Column, earlierDate: Column): Column

    Permalink

    Computes number of days between two specified dates in "yyyyMMdd" format

    Computes number of days between two specified dates in "yyyyMMdd" format

    laterDate

    input date

    earlierDate

    input date

    returns

    number of days between laterDate and earlierDate or null if either one is null

  27. val date_month_end: UserDefinedFunction

    Permalink
  28. val datetime_add: UserDefinedFunction

    Permalink
  29. def datetime_add_months(input: Column, months: Int): Column

    Permalink

    Returns the internal representation of a timestamp resulting from adding (or subtracting) a number of months to the specified timestamp.

    Returns the internal representation of a timestamp resulting from adding (or subtracting) a number of months to the specified timestamp.

    input

    timestamp in yyyy-MM-dd HH:mm:ss.SSSS format

  30. val datetime_difference: UserDefinedFunction

    Permalink
  31. def datetime_difference_hours(end: Column, start: Column): Column

    Permalink

    Returns the number of hours between two specified dates in standard format yyyy-MM-dd HH:mm:ss.SSSS.

  32. def datetime_difference_minutes(end: Column, start: Column): Column

    Permalink

    Returns the number of minutes between two specified dates in standard format yyyy-MM-dd HH:mm:ss.SSSS.

  33. def datetime_from_unixtime(seconds: Column): Column

    Permalink
  34. def decimal_lpad(input: Column, len: Int, char_to_pad_with: String = "0", decimal_point_char: String = "."): Column

    Permalink

    Method uses a java regex to identify decimal numbers from input string.

    Method uses a java regex to identify decimal numbers from input string. This decimal number could be of 3 types 1. Simple integral number. e.g. 013334848. This part is identified by regex. 2. decimal number with explicit decimal point. e.g. 123456.90. This part is identified by combination of [0-9]+(\$$decimal_point_char)[0-9]+ and (0\$$decimal_point_char)[0-9]+ regex

    After extracting decimal number this code checks if length of decimal number is more than len parameter or not. If length is more than len parameter then it simply returns this extracted decimal number. Otherwise it first left pad decimal number with char_to_pad_with to make its length equal to len parameter and then adjusts minus sign (-) to left most part of decimal number.

    input

    input string.

    len

    length of characters.

    char_to_pad_with

    character to left pad with. default value is "0"

    decimal_point_char

    A string that specifies the character that represents the decimal point.

    returns

    a decimal string of the specified length or longer, left-padded with a specified character as needed and trimmed of leading zeros.

  35. def decimal_lrepad(input: Column, len: Int, char_to_pad_with: String = "0", decimal_point_char: String = "."): Column

    Permalink

    Method uses a java regex to identify decimal numbers from input string.

    Method uses a java regex to identify decimal numbers from input string. This decimal number could be of 3 types 1. Simple integral number. e.g. 013334848. This part is identified by combination of [1-9][0-9]*[0-9] and [1-9]+ regex 2. decimal number with explicit decimal point. e.g. 123456.90. This part is identified by combination of [1-9][0-9]*(\\\$$decimal_point_char)[0-9]+ and (0\\\$$decimal_point_char)[0-9]*[0-9] regex

    After extracting decimal number this code checks if length of decimal number is more than len parameter or not. If length is more than len parameter then it simply returns this extracted decimal number. Otherwise it first left pad decimal number with char_to_pad_with to make its length equal to len parameter and then adjusts minus sign (-) to left most part of decimal number.

    input

    input string.

    len

    length of characters.

    char_to_pad_with

    character to left pad with. default value is "0"

    decimal_point_char

    A string that specifies the character that represents the decimal point.

    returns

    a decimal string of the specified length or longer, left-padded with a specified character as needed and trimmed of leading zeros.

  36. def decimal_round(input: Column, places: Int): Column

    Permalink
  37. def decimal_round_down(input: Column, right_digits: Int): Column

    Permalink

    Function returns a value which is rounded down to right_digits number of digits to the right of decimal point.

  38. def decimal_round_up(input: Column, places: Int): Column

    Permalink

    Returns a number rounded up to a specified number of places to the right of the decimal point.

  39. def decimal_strip(input: Column, decimal_point_char: String = "."): Column

    Permalink

    Function uses a java regex to identify decimal numbers from input string.

    Function uses a java regex to identify decimal numbers from input string. This decimal number could be of 3 types 1. Simple integral number. e.g. 013334848. This part is identified by combination of [1-9][0-9 ]*[0-9] and [1-9]+ regex 2. decimal number with explicit decimal point. e.g. 123456.90. This part is identified by combination of [1-9][0-9]*(\$$decimal_point_char)[0-9 ]+ and (0\$$decimal_point_char)[0-9 ]*[0-9] regex

    After extracting decimal number this code looks for minus sign before extracted number in input and appends it with decimal number if found minus sign.

    In the end it replaces all whitespaces with empty string in the final resultant decimal number.

    input

    input string

    decimal_point_char

    A string that specifies the character that represents the decimal point.

    returns

    a decimal from a string that has been trimmed of leading zeros and non-numeric characters.

  40. def decimal_truncate(input: Column, number_of_places: Column): Column

    Permalink
  41. val decodeBytes: UserDefinedFunction

    Permalink
  42. val decodeString: UserDefinedFunction

    Permalink
  43. val decode_datetime: UserDefinedFunction

    Permalink

    UDF to get record of type decode_datetime_type.

    UDF to get record of type decode_datetime_type. This record will have all its fields populated with corresponding entries in input date/timestamp.

    Returned record will have following schema.

    integer(8) year; integer(8) month; integer(8) day; integer(8) hour; integer(8) minute; integer(8) second; integer(8) microsecond;

    Note: Supported Input time is in yyyy-MM-dd HH:mm:ss.SSSSSS or yyyy-MM-dd HH:mm:ss or yyyy-MM-dd formats only. Additional handling is done to support timestamp retrieved from now() function call.

  44. val decode_datetime_as_local: UserDefinedFunction

    Permalink
  45. def directory_listing(path: String, filePrefix: String): Column

    Permalink
  46. val encodeBytes: UserDefinedFunction

    Permalink
  47. val encodeString: UserDefinedFunction

    Permalink
  48. val encode_date: UserDefinedFunction

    Permalink

    integer values specifying days relative to January 1, 1900.

    integer values specifying days relative to January 1, 1900. This function returns the internal representation of a date given the year, month, and date. encode_date returns the internal representation of the date specified by the year 1998, the month 5, and the day 18:encode_date(1998, 5, 18) = 35931

  49. val encrypt_idwdata: UserDefinedFunction

    Permalink
  50. def ends_with(input: Column, suffix: String): Column

    Permalink

    Returns true if string columns ends with given suffix

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  53. val eval: UserDefinedFunction

    Permalink

    Method to return the result of evaluating a string expression in the context of a specified input column.

    Method to return the result of evaluating a string expression in the context of a specified input column. Here input column could be struct type record, simple column, array type etc. Here expr could be reference to nested column inside input column or any expression which requires values from input column for its evaulation.

    Note: Current implementation only supports scenerio where input column is of struct type and expr is simply dot separated column reference to input struct.

  54. val extract_mel_dates_Udf: UserDefinedFunction

    Permalink
  55. val ff3_encrypt_idwdata: UserDefinedFunction

    Permalink
  56. val file_information: UserDefinedFunction

    Permalink

    UDF to get file information for passed input file path.

  57. def findFirstElement(input: Column, default: Column = lit(null)): Column

    Permalink
  58. def findFirstNonBlankElement(input: Column, default: Column): Column

    Permalink
  59. def findLastElement(input: Column, default: Column = lit(null)): Column

    Permalink
  60. def first_defined(expr1: Column, expr2: Column): Column

    Permalink

    Method to identify and return first non null expression.

  61. val first_defined_for_double_Udf: UserDefinedFunction

    Permalink
  62. def flattenStructSchema(schema: StructType, prefix: String = null): Array[Column]

    Permalink
  63. val force_error: UserDefinedFunction

    Permalink
  64. def from_sv(input: Column, separator: String, schema: StructType): Column

    Permalink
  65. def from_xml(content: Column, schema: StructType): Column

    Permalink
  66. def generateDataFrameWithSequenceColumn(start: Int, end: Int, columnName: String, sparkSession: SparkSession): DataFrame

    Permalink

    Method to create dataframe with single column containing increasing sequence id from start to end.

  67. def generate_sequence(start: Int, end: Int, step: Int = 1): Column

    Permalink

    Function to create sequence of array between two passed numbers

    Function to create sequence of array between two passed numbers

    start

    starting point of generated sequence

    end

    terminating point of generated sequence.

    returns

    column containing sequence of integers.

  68. val generate_sequence: UserDefinedFunction

    Permalink

    UDF to generate column with sequence of integers between two passed start and end columns.

  69. val getByteFromByteArray: UserDefinedFunction

    Permalink

    UDF to get last Byte from ByteArray of input data.

  70. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  71. def getColumnInSecondArrayByFirstNonBlankPositionInFirstArray(nonBlankEntryExpr: Column, firstArray: Column, secondArray: Column): Column

    Permalink
  72. def getContentAsStream(content: String): StringAsStream

    Permalink
  73. def getFebruaryDay(year: Column): Column

    Permalink

    Computes number of days in February month in a given year

    Computes number of days in February month in a given year

    year

    year whose number of days in February needs to be calculated

    returns

    number of days

  74. def getFieldFromStructByPosition(column: Column, position: Int): Column

    Permalink

    Method to get field at specific position from struct column

  75. val getIntFromByteArray: UserDefinedFunction

    Permalink

    UDF to get integer comprising of last 4 Bytes from ByteArray of input data.

  76. val getLongArrayFromByteArray: UserDefinedFunction

    Permalink

    UDF to get long comprising of last 8 Bytes from ByteArray of input data.

  77. val getLongFromByteArray: UserDefinedFunction

    Permalink

    UDF to get long comprising of last 8 Bytes from ByteArray of input data.

  78. def getMTimeDataframe(filepath: String, format: String, spark: SparkSession): DataFrame

    Permalink
  79. val getShortFromByteArray: UserDefinedFunction

    Permalink

    UDF to get short comprising of last 2 Bytes from ByteArray of input data.

  80. val get_partial_drug_details_Udf: UserDefinedFunction

    Permalink

    let string("") get_partial_drug_details = get_partial_drug_details_Udf(v_prod_id,v_gpi_no,v_filled_dt,v_mel_thrgh_dt,v_mpa_thrgh_dt,lookup_row("lkp_cag_ndc_gpi",v_cag_sk),for (j, j < count): lookup_row("lkp_ndc_gpi_list",first_defined(lookup_row("lkp_cag_ndc_gpi",v_cag_sk)[j].drug_name_list,'-'))); out :: (string("")) string_concat((string(""))(decimal(""))get_partial_drug_details,'|',(string(""))(decimal("")) v_gf_flg); out :: get_drug_details(v_cag_sk, v_prod_id, v_gpi_no, v_filled_dt, v_mel_thrgh_dt, v_mpa_thrgh_dt,v_prior_auth_nbr)= begin let string("") pattern=first_defined(lookup("lkp_cag_ndc_gpi",v_cag_sk).idntfn_gf,'-'); let string("") flag=first_defined(lookup("lkp_cag_ndc_gpi",v_cag_sk).include_exclude_gf,'-'); let int count = lookup_count("lkp_cag_ndc_gpi",v_cag_sk); let int ndc_count = 0; let int rule_cnt = 0; let int ndc_rule_cnt = 0; let rec_vec v_rec = allocate_with_nulls(); let ndc_rec_vec v_ndc_rec = allocate_with_nulls(); let int drug_match = 0; let string(1) drug_match_ind = '0'; let int claim_flg = 0; let int mbr_flg = 0; let int exact_flg = 0; let int c_valid_rec = 0; let int m_valid_rec = 0; let int v_prior_auth_flg = 0; let int exact_inc_flg = 0; let int exact_exc_flg = 0; let string("") v_rec_drug_name_list = "-"; let int v_gf_flg=0; v_gf_flg= if(flag=='I' and string_index(v_prior_auth_nbr,pattern)!=0)1 else if(flag=='E' and string_index(v_prior_auth_nbr,pattern)!=0)0 else if(flag=='I' and string_index(v_prior_auth_nbr,pattern)==0)0 else if(flag=='E' and string_index(v_prior_auth_nbr,pattern)==0)1 else if(flag=='-' or pattern=='-')2 else 2; while (count > rule_cnt) begin v_rec = lookup_next("lkp_cag_ndc_gpi"); v_rec_drug_name_list = first_defined(v_rec.drug_name_list,'-'); if(string_upcase(v_rec.drug_type) member [vector 'GPI LIST','NDC LIST'] && !is_null(v_rec.drug_name_list)) begin ndc_count = lookup_count("lkp_ndc_gpi_list",v_rec_drug_name_list); ndc_rule_cnt=0; while (ndc_count > ndc_rule_cnt) begin v_ndc_rec = lookup_next("lkp_ndc_gpi_list"); drug_match = if(is_null(v_rec.drug_type) || is_blank(v_rec.drug_type) || first_defined(v_rec.drug_type,'-') == '-' || (string_upcase(v_rec.drug_type) == 'GPI LIST' && (starts_with(string_downcase(v_gpi_no), string_downcase(v_ndc_rec.ndc_gpi)) == 1 || v_ndc_rec.list_name == '-')) || (string_upcase(v_rec.drug_type) == 'NDC LIST' && (starts_with(string_downcase(v_prod_id), string_downcase(v_ndc_rec.ndc_gpi)) == 1 || v_ndc_rec.list_name == '-'))) 1 else 0;

    let string("") get_partial_drug_details = get_partial_drug_details_Udf(v_prod_id,v_gpi_no,v_filled_dt,v_mel_thrgh_dt,v_mpa_thrgh_dt,lookup_row("lkp_cag_ndc_gpi",v_cag_sk),for (j, j < count): lookup_row("lkp_ndc_gpi_list",first_defined(lookup_row("lkp_cag_ndc_gpi",v_cag_sk)[j].drug_name_list,'-'))); out :: (string("")) string_concat((string(""))(decimal(""))get_partial_drug_details,'|',(string(""))(decimal("")) v_gf_flg); out :: get_drug_details(v_cag_sk, v_prod_id, v_gpi_no, v_filled_dt, v_mel_thrgh_dt, v_mpa_thrgh_dt,v_prior_auth_nbr)= begin let string("") pattern=first_defined(lookup("lkp_cag_ndc_gpi",v_cag_sk).idntfn_gf,'-'); let string("") flag=first_defined(lookup("lkp_cag_ndc_gpi",v_cag_sk).include_exclude_gf,'-'); let int count = lookup_count("lkp_cag_ndc_gpi",v_cag_sk); let int ndc_count = 0; let int rule_cnt = 0; let int ndc_rule_cnt = 0; let rec_vec v_rec = allocate_with_nulls(); let ndc_rec_vec v_ndc_rec = allocate_with_nulls(); let int drug_match = 0; let string(1) drug_match_ind = '0'; let int claim_flg = 0; let int mbr_flg = 0; let int exact_flg = 0; let int c_valid_rec = 0; let int m_valid_rec = 0; let int v_prior_auth_flg = 0; let int exact_inc_flg = 0; let int exact_exc_flg = 0; let string("") v_rec_drug_name_list = "-"; let int v_gf_flg=0; v_gf_flg= if(flag=='I' and string_index(v_prior_auth_nbr,pattern)!=0)1 else if(flag=='E' and string_index(v_prior_auth_nbr,pattern)!=0)0 else if(flag=='I' and string_index(v_prior_auth_nbr,pattern)==0)0 else if(flag=='E' and string_index(v_prior_auth_nbr,pattern)==0)1 else if(flag=='-' or pattern=='-')2 else 2; while (count > rule_cnt) begin v_rec = lookup_next("lkp_cag_ndc_gpi"); v_rec_drug_name_list = first_defined(v_rec.drug_name_list,'-'); if(string_upcase(v_rec.drug_type) member [vector 'GPI LIST','NDC LIST'] && !is_null(v_rec.drug_name_list)) begin ndc_count = lookup_count("lkp_ndc_gpi_list",v_rec_drug_name_list); ndc_rule_cnt=0; while (ndc_count > ndc_rule_cnt) begin v_ndc_rec = lookup_next("lkp_ndc_gpi_list"); drug_match = if(is_null(v_rec.drug_type) || is_blank(v_rec.drug_type) || first_defined(v_rec.drug_type,'-') == '-' || (string_upcase(v_rec.drug_type) == 'GPI LIST' && (starts_with(string_downcase(v_gpi_no), string_downcase(v_ndc_rec.ndc_gpi)) == 1 || v_ndc_rec.list_name == '-')) || (string_upcase(v_rec.drug_type) == 'NDC LIST' && (starts_with(string_downcase(v_prod_id), string_downcase(v_ndc_rec.ndc_gpi)) == 1 || v_ndc_rec.list_name == '-'))) 1 else 0;

    claim_flg = if (date_difference_days((date("YYYYMMDD")) (datetime("YYYYMMDD")) now(), (date("YYYYMMDD")) v_filled_dt) <= (int) (decimal("")) v_rec.lookback_days) 1 else 0; mbr_flg = if (date_difference_days((date("YYYYMMDD")) v_mel_thrgh_dt, (date("YYYYMMDD")) (datetime("YYYYMMDD")) now()) >= (int) (decimal("")) v_rec.mel_lookforward) 1 else 0;

    c_valid_rec = if (v_rec.include_exclude == 'I' && exact_inc_flg == 0 && exact_exc_flg == 0) if (drug_match == 0) 0 else if (drug_match == 1 && claim_flg == 1) 1 else 0 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0 && exact_inc_flg == 1) if (drug_match == 1 && claim_flg == 1) 0 else 1 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0) if (drug_match == 1 && claim_flg == 1) 0 else if (drug_match == 1 && claim_flg == 0 && (rule_cnt != 0 && c_valid_rec == 1)) 1 else if (drug_match == 0 && claim_flg == 1 && ((rule_cnt != 0 && c_valid_rec == 1) || rule_cnt == 0)) 1 else 0 else c_valid_rec; m_valid_rec = if (v_rec.include_exclude == 'I' && exact_inc_flg == 0 && exact_exc_flg == 0) if (drug_match == 0) 0 else if (drug_match == 1 && mbr_flg == 1) 1 else 0 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0 && exact_inc_flg == 1) if (drug_match == 1 && mbr_flg == 1) 0 else 1 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0) if (drug_match == 1 && mbr_flg == 1) 0 else if (drug_match == 1 && mbr_flg == 0 && (rule_cnt != 0 && m_valid_rec == 1)) 1 else if (drug_match == 0 && mbr_flg == 1 && ((rule_cnt != 0 && m_valid_rec == 1) || rule_cnt == 0)) 1 else 0 else m_valid_rec; exact_inc_flg = if (v_rec.include_exclude == 'I' && drug_match == 1) 1 else exact_inc_flg; exact_exc_flg = if (v_rec.include_exclude == 'E' && drug_match == 1) 1 else exact_exc_flg; v_prior_auth_flg = if ((v_prior_auth_flg == 0 && date_difference_days((date("YYYYMMDD")) v_mpa_thrgh_dt, (date("YYYYMMDD")) (datetime("YYYYMMDD")) now()) == (int) (decimal("")) v_rec.pa_lookforward) || v_prior_auth_flg == 1) 1 else 0; ndc_rule_cnt = ndc_rule_cnt + 1; end end else begin drug_match = if(is_null(v_rec.drug_type) || is_blank(v_rec.drug_type) || first_defined(v_rec.drug_type,'-') == '-' || (string_upcase(v_rec.drug_type) member [vector 'GPI LIST', 'NDC LIST'] && v_rec.drug_name_list == '-') || (string_upcase(v_rec.drug_type) == 'GPI' && (starts_with(string_downcase(v_gpi_no), string_downcase(v_rec.drug_name_list)) == 1 || v_rec.drug_name_list == '-')) || (string_upcase(v_rec.drug_type) == 'NDC' && (starts_with(string_downcase(v_prod_id), string_downcase(v_rec.drug_name_list)) == 1 || v_rec.drug_name_list == '-'))) 1 else 0;

    claim_flg = if (date_difference_days((date("YYYYMMDD")) (datetime("YYYYMMDD")) now(), (date("YYYYMMDD")) v_filled_dt) <= (int) (decimal("")) v_rec.lookback_days) 1 else 0;

    mbr_flg = if (date_difference_days((date("YYYYMMDD")) v_mel_thrgh_dt, (date("YYYYMMDD")) (datetime("YYYYMMDD")) now()) >= (int) (decimal("")) v_rec.mel_lookforward) 1 else 0;

    c_valid_rec = if (v_rec.include_exclude == 'I' && exact_inc_flg == 0 && exact_exc_flg == 0) if (drug_match == 0) 0 else if (drug_match == 1 && claim_flg == 1) 1 else 0 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0 && exact_inc_flg == 1) if (drug_match == 1 && claim_flg == 1) 0 else 1 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0) if (drug_match == 1 && claim_flg == 1) 0 else if (drug_match == 1 && claim_flg == 0 && (rule_cnt != 0 && c_valid_rec == 1)) 1 else if (drug_match == 0 && claim_flg == 1 && ((rule_cnt != 0 && c_valid_rec == 1) || rule_cnt == 0)) 1 else 0 else c_valid_rec; m_valid_rec = if (v_rec.include_exclude == 'I' && exact_inc_flg == 0 && exact_exc_flg == 0) if (drug_match == 0) 0 else if (drug_match == 1 && mbr_flg == 1) 1 else 0 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0 && exact_inc_flg == 1) if (drug_match == 1 && mbr_flg == 1) 0 else 1 else if (v_rec.include_exclude == 'E' && exact_exc_flg == 0) if (drug_match == 1 && mbr_flg == 1) 0 else if (drug_match == 1 && mbr_flg == 0 && (rule_cnt != 0 && m_valid_rec == 1)) 1 else if (drug_match == 0 && mbr_flg == 1 && ((rule_cnt != 0 && m_valid_rec == 1) || rule_cnt == 0)) 1 else 0 else m_valid_rec; exact_inc_flg = if (v_rec.include_exclude == 'I' && drug_match == 1) 1 else exact_inc_flg; exact_exc_flg = if (v_rec.include_exclude == 'E' && drug_match == 1) 1 else exact_exc_flg; v_prior_auth_flg = if ((v_prior_auth_flg == 0 && date_difference_days((date("YYYYMMDD")) v_mpa_thrgh_dt, (date("YYYYMMDD")) (datetime("YYYYMMDD")) now()) == (int) (decimal("")) v_rec.pa_lookforward) || v_prior_auth_flg == 1) 1 else 0; end rule_cnt = rule_cnt + 1; end

    out :: (string("")) string_concat((string(""))(decimal(""))c_valid_rec,'|',(string(""))(decimal("")) m_valid_rec,'|',(string(""))(decimal("")) v_prior_auth_flg,'|',(string(""))(decimal("")) v_gf_flg); end;

  81. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  82. val hash_MD5: UserDefinedFunction

    Permalink
  83. val instr_udf: UserDefinedFunction

    Permalink
  84. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  85. def isNullOrEmpty(input: Column): Column

    Permalink

    Method to check if current column is null or has empty value.

  86. def is_ascii(input: Column): Column

    Permalink

    Checks if a string is ascii

    Checks if a string is ascii

    input

    column to be checked

    returns

    true if the input string is ascii otherwise false

  87. def is_blank(input: Column): Column

    Permalink

    Method to identify if input string is a blank string or not.

    Method to identify if input string is a blank string or not.

    input

    input string.

    returns

    return 1 if given string contains all blank character or is a zero length string, otherwise it returns 0

  88. val is_blank_udf: UserDefinedFunction

    Permalink
  89. val is_bzero: UserDefinedFunction

    Permalink

    Tests whether an object is composed of all binary zero bytes.

    Tests whether an object is composed of all binary zero bytes. This function returns: 1. 1 if obj contains only binary zero bytes or is a zero-length string 2. 0 if obj contains any non-zero bytes 3. NULL if obj is NULL

  90. def is_numeric_ascii(input: Column): Column

    Permalink

    Checks if an input string contains only ascii code and numbers

    Checks if an input string contains only ascii code and numbers

    input

    string to be checked

    returns

    true if input string contains only ascii code and numbers or null if input is null

  91. def is_valid(input: Column, isNullable: Boolean, formatInfo: Option[Any], len: Option[Seq[Int]]): Column

    Permalink

    Method to identify if passed input column is a valid expression after typecasting to passed dataType.

    Method to identify if passed input column is a valid expression after typecasting to passed dataType. Also while typecasting if len is present then this function also makes sure the max length of input column after typecasting operation is not greater than len.

    input

    input column expression to be identified if is valid.

    formatInfo

    datatype to which input column expression must be typecasted. If datatype is a string then it is treated as timestamp format. If it is a list of string then it is treated as having current timestamp format and and new timestamp format to which input column needs to be typecasted.

    len

    max length of input column after typecasting it to dataType.

    returns

    0 if input column is not valid after typecasting or 1 if it is valid.

  92. def is_valid(input: Column, isNullable: Boolean, formatInfo: Option[Any]): Column

    Permalink
  93. def is_valid(input: Column, formatInfo: Option[Any], len: Option[Seq[Int]]): Column

    Permalink
  94. def is_valid(input: Column, formatInfo: Option[Any]): Column

    Permalink
  95. def is_valid(input: Column, isNullable: Boolean): Column

    Permalink
  96. def is_valid(input: Column): Column

    Permalink
  97. def is_valid_date(dateFormat: String, inDate: Column): Column

    Permalink

    Validates date against a input format

    Validates date against a input format

    dateFormat

    A pattern such as yyyy-MM-dd or yyyy-MM-dd HH:mm:ss.SSSS or dd.MM.yyyy

    inDate

    Input date to be validated

    returns

    true if the input date is valid otherwise false

  98. def lastElementInCurrentWindow(input: Column): Column

    Permalink
  99. val make_byte_flags: UserDefinedFunction

    Permalink

    UDF to return a flag for each character if it is present or not in input String.

  100. def make_constant_vector(size: Int, seedVal: Int): Array[Int]

    Permalink

    Method to create array of size "size" containing seedVal as each entry

  101. def make_constant_vector(size: Int, seedVal: Column): Column

    Permalink

    Method to create array of size "size" containing seedVal as each entry

  102. val member_elig_rec_Udf: UserDefinedFunction

    Permalink
  103. val multi_regex_match: UserDefinedFunction

    Permalink
  104. def multi_regex_replace_with_char_conversion(input: Column, charSet: Column, replaceStr: Column, replacement0: String, replacement1: String, pattern: String*): Column

    Permalink
  105. val multifile_information: UserDefinedFunction

    Permalink

    UDF to get multifile information for passed input file path.

  106. val murmur: UserDefinedFunction

    Permalink

    UDF for murmur hash generation for any column type

  107. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  110. def now(): Column

    Permalink

    Method to get current timestamp.

    Method to get current timestamp.

    returns

    current timestamp in YYYYMMddHHmmssSSSSSS format.

  111. def numberOfPartitions(in: DataFrame): Column

    Permalink
  112. val number_grouping: UserDefinedFunction

    Permalink

    udf to group input decimal into multiple groups separated by separator

  113. val packedBytesStringToDecimal: UserDefinedFunction

    Permalink
  114. val packedBytesToDecimal: UserDefinedFunction

    Permalink
  115. val re_get_match: UserDefinedFunction

    Permalink

    Returns the first string in a target string that matches a regular expression.

  116. val re_get_match_with_index: UserDefinedFunction

    Permalink
  117. val re_index: UserDefinedFunction

    Permalink

    UDF wrapper over re_index function.

  118. val re_index_with_offset: UserDefinedFunction

    Permalink

    Returns the first string in a target string that matches a regular expression.

  119. def re_replace(target: Column, pattern: String, replacement: String, offset: Int = 0): Column

    Permalink

    Replaces all substrings in a target string that match a specified regular expression.

    Replaces all substrings in a target string that match a specified regular expression.

    target

    A string that the function searches for a substring that matches pattern_expr.

    pattern

    regular expression

    replacement

    replacement string

    offset

    Number of characters, from the beginning of str, to skip before searching.

    returns

    a replaced string in which all substrings, which matches a specified regular expression, are replaced.

  120. def re_replace_first(target: Column, pattern: String, replacement: String, offset: Column = lit(0)): Column

    Permalink

    Replaces only the first regex matching occurrence in the target string.

    Replaces only the first regex matching occurrence in the target string.

    target

    A string that the function searches for a substring that matches pattern_expr.

    pattern

    regular expression

    replacement

    replacement string

    returns

    a replaced string in which first substring, which matches a specified regular expression, is replaced.

  121. val re_split_no_empty: UserDefinedFunction

    Permalink

    UDF to split input string via pattern string and remove all empty subtrings.

  122. val readBytesIntoInteger: UserDefinedFunction

    Permalink
  123. val readBytesIntoLong: UserDefinedFunction

    Permalink
  124. val readBytesStringIntoInteger: UserDefinedFunction

    Permalink
  125. val readBytesStringIntoLong: UserDefinedFunction

    Permalink
  126. val read_file: UserDefinedFunction

    Permalink
  127. val record_info: UserDefinedFunction

    Permalink
  128. val record_info_with_includes: UserDefinedFunction

    Permalink
  129. def registerAllUDFs(spark: SparkSession): Unit

    Permalink
  130. def remove_non_digit(input: Column): Column

    Permalink

    Method removes any non-digit characters from the specified string column.

    Method removes any non-digit characters from the specified string column.

    input

    input String Column

    returns

    Cleaned string column or null

  131. def replaceBlankColumnWithNull(input: Column): Column

    Permalink

    Method to replace String Columns with Empty value to Null.

  132. def replace_null_with_blank(input: Column): Column

    Permalink
  133. def scanf_double(format: Column, value: Column): Column

    Permalink
  134. def scanf_long(format: Column, value: Column): Column

    Permalink
  135. def schemaRowCompareResult(row1: StructType, row2: StructType): Column

    Permalink
  136. def sign_explicit(c: Column): Column

    Permalink

    Adds an explicit sign to the number.

    Adds an explicit sign to the number. E.g. 2 -> +2; -004 -> -004; 0 -> +0

  137. val sign_explicit_Udf: UserDefinedFunction

    Permalink
  138. def sign_reserved(c: Column): Column

    Permalink
  139. val sign_reserved_Udf: UserDefinedFunction

    Permalink
  140. val splitIntoMultipleColumnsUdf: UserDefinedFunction

    Permalink

    UDF to break input string into multiple string via delimiter.

    UDF to break input string into multiple string via delimiter. Number of strings after split are adjusted as per passed width parameter. If number of strings are less then empty strings are added otherwise in case of more number of strings, first width number of entries are picked and remaining are discarded.

  141. def starts_with(input: Column, prefix: String): Column

    Permalink

    Returns true if string columns starts with given prefix

  142. def string_char(inputStr: Column, index: Int): Column

    Permalink

    Method to return character code of character at index position in inputStr string.

    Method to return character code of character at index position in inputStr string.

    inputStr

    input string

    index

    location of character to get code.

    returns

    integer column.

  143. val string_cleanse: UserDefinedFunction

    Permalink

    This implementation is incorrect.

  144. def string_compare(input1: Column, input2: Column): Column

    Permalink
  145. val string_concat_in_loop: UserDefinedFunction

    Permalink
  146. val string_convert_explicit: UserDefinedFunction

    Permalink

    Converts a string from one character set to another, replacing inconvertible characters with a specified string.

  147. val string_filter: UserDefinedFunction

    Permalink

    Method which returns string of characters present in both of the strings in the same order as appearing in first string

  148. val string_filter_out: UserDefinedFunction

    Permalink

    Compares two input strings, then returns characters that appear in one string but not in the other.

  149. val string_from_hex: UserDefinedFunction

    Permalink
  150. val string_index: UserDefinedFunction

    Permalink

    UDF to find index of seekStr in inputStr.

    UDF to find index of seekStr in inputStr. Returned index will be 1 based index.

  151. val string_index_with_offset: UserDefinedFunction

    Permalink

    UDF to find index of seekStr in inputStr from offset index onwards.

    UDF to find index of seekStr in inputStr from offset index onwards. Returned string position is 1 based position.

  152. def string_is_alphabetic(input: Column): Column

    Permalink

    Method which returns true if input string contains all alphabetic characters, or false otherwise.

  153. def string_is_numeric(input: Column): Column

    Permalink

    Method which returns true if input string contains all numeric characters, or false otherwise.

  154. def string_join(column: Column, delimiter: String): Column

    Permalink

    Concatenates the elements of column using the delimiter.

  155. def string_length(input: Column): Column

    Permalink
  156. val string_like: UserDefinedFunction

    Permalink

    Method to test whether a string matches a specified pattern.

    Method to test whether a string matches a specified pattern. This function returns 1 if the input string matches a specified pattern, and 0 if the string does not match the pattern.

    In abinitio version % character in pattern means to match zero or more characters and _ character means matches a single character.

  157. def string_lpad(input: Column, len: Int, pad_char: String = " "): Column

    Permalink

    Left-pad the input string column with pad_char to a length of len.

    Left-pad the input string column with pad_char to a length of len. If length of input column is more than len then returns input column unmodified.

  158. def string_lrepad(input: Column, len: Int, char_to_pad_with: String = " "): Column

    Permalink

    function trims the string and then pad the string with given character upto given length.

    function trims the string and then pad the string with given character upto given length. if the length of trimmed string is equal to or greater than given length than it return input string

    input

    input string

    len

    length in number of characters.

    char_to_pad_with

    A character used to pad input string to length len.

    returns

    string of a specified length, trimmed of leading and trailing blanks and left-padded with a given character.

  159. def string_pad(input: Column, len: Int, char_to_pad_with: String = " "): Column

    Permalink

    function pads input on the right with the character char_to_pad_with to make the string length len.

    function pads input on the right with the character char_to_pad_with to make the string length len. If str is already len or more characters long, the function returns input unmodified.

  160. val string_pad: UserDefinedFunction

    Permalink
  161. val string_pad_with_char: UserDefinedFunction

    Permalink
  162. def string_prefix(input: Column, length: Column): Column

    Permalink
  163. def string_repad(input: Column, len: Int, char_to_pad_with: String = " "): Column

    Permalink

    function trims the string and then pad the string on right side with given character upto given length.

    function trims the string and then pad the string on right side with given character upto given length. if the length of trimmed string is equal to or greater than given length than it return input string

    input

    input string

    len

    length in number of characters.

    char_to_pad_with

    A character used to pad input string to length len.

    returns

    string of a specified length, trimmed of leading and trailing blanks and left-padded with a given character.

  164. def string_replace(input: Column, seekStr: Column, newStr: Column, offset: Column = lit(0)): Column

    Permalink

    Function to replace occurrence of seekStr with newStr string in input string after offset characters from first character.

    Function to replace occurrence of seekStr with newStr string in input string after offset characters from first character.

    input

    input string on which to perform replace operation.

    seekStr

    string to be replaced in input string.

    newStr

    string to be used instead of seekStr in input string.

    offset

    number of characters to skip from begining in input string before performing string_replace operation.

    returns

    modified string where seekStr is replaced with newStr in input string.

  165. val string_replace_first: UserDefinedFunction

    Permalink
  166. val string_replace_first_in_loop: UserDefinedFunction

    Permalink
  167. val string_replace_in_loop: UserDefinedFunction

    Permalink
  168. val string_representation: UserDefinedFunction

    Permalink
  169. val string_rindex: UserDefinedFunction

    Permalink

    Returns the index of the first character of the last occurrence of a seek string within another input string.

    Returns the index of the first character of the last occurrence of a seek string within another input string. Returned index is 1 based.

  170. val string_rindex_with_offset: UserDefinedFunction

    Permalink

    UDF to find index of seekStr in inputStr from end of inputStr skipping offset number of characters from end.

    UDF to find index of seekStr in inputStr from end of inputStr skipping offset number of characters from end. Offset index is number of characters, from the end of str, to skip before searching. Returned string position is 1 based position.

  171. val string_split: UserDefinedFunction

    Permalink

    UDF to split input string via delimiter string.

  172. val string_split_no_empty: UserDefinedFunction

    Permalink

    UDF to split input string via delimiter string and remove all empty subtrings.

  173. def string_substring(input: Column, start_position: Column, length: Column): Column

    Permalink

    Method to find substring of input string.

    Method to find substring of input string.

    input

    string on which to find substring.

    start_position

    1 based starting position to find substring from.

    length

    total length of substring to be found.

    returns

    substring of input string

  174. def string_suffix(input: Column, len: Int): Column

    Permalink
  175. val string_to_hex: UserDefinedFunction

    Permalink
  176. val sv_apply: UserDefinedFunction

    Permalink
  177. val sv_create_collection: UserDefinedFunction

    Permalink
  178. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  179. val test_characters_all: UserDefinedFunction

    Permalink

    UDF to identify the number of characters in inputStr which are present in charFlag

  180. def timezone_to_utc(timezone: String, time: Column): Column

    Permalink

    Method to convert

  181. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  182. def today(): Column

    Permalink

    Method to return integer value representing number of days to today from “1-1-1990”.

    Method to return integer value representing number of days to today from “1-1-1990”.

    returns

    integer value

  183. val translate_bytes: UserDefinedFunction

    Permalink

    UDF to return a string in the native character set made up of bytes from the given map.

    UDF to return a string in the native character set made up of bytes from the given map. Each byte of the result is the value of map indexed by the character code of the corresponding byte of the input string str. The function returns NULL if any argument is NULL.

  184. val truncateMicroSeconds: UserDefinedFunction

    Permalink

    UDF to truncate microseconds part of timestamp.

    UDF to truncate microseconds part of timestamp. This is needed as abinitio and spark has some incompatibility in microseconds part of timestamp format.

  185. val type_info: UserDefinedFunction

    Permalink
  186. val type_info_with_includes: UserDefinedFunction

    Permalink
  187. val unique_identifier: UserDefinedFunction

    Permalink
  188. val url_encode_escapes: UserDefinedFunction

    Permalink
  189. final def wait(arg0: Long, arg1: Int): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  192. val writeIntegerToBytes: UserDefinedFunction

    Permalink
  193. val writeLongToBytes: UserDefinedFunction

    Permalink
  194. val xmlToJSON: UserDefinedFunction

    Permalink
  195. def yyyyMMdd_to_YYYYJJJ(in_date: Column): Column

    Permalink

    Converts yyyyyMMdd to YYYYJJJ

    Converts yyyyyMMdd to YYYYJJJ

    in_date

    date in yyyyMMdd format

    returns

    a date converted to YYYYJJJ

  196. def zip_eventInfo_arrays(column1: Column, column2: Column): Column

    Permalink

    Method to zip two arrays with first one having event_type and second one having event_text

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