Skip to content

Collection of my Scala Hive UDFs - Hive iLike, crc32, days_between,months_between

License

Notifications You must be signed in to change notification settings

lserinol/Hive-udfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hive-udfs

Collection of my Scala Hive UDFs

Requirements

  • SBT
  • Scala
  • Hive

Compile

  1. git clone/fork project https://github.com/lserinol/Hive-udfs.git
  2. sbt assembly
  3. add jar 'target/scala-version number/levent-hive-funcs-assembly-version number.jar' to HIVE_AUX_JARS_FILE_PATH
    or use "add jar" command for Hive-CLI/Beeline

Registering UDFs

create temporary function lcrc32 as 'com.levent.hive.udfs.lcrc32';
create temporary function ldays_between as 'com.levent.hive.udfs.ldays_between';
create temporary function lmonths_between as 'com.levent.hive.udfs.lmonths_between';
create temporary function ilike as 'com.levent.hive.udfs.liLIKE';
create temporary function urldecode as 'com.levent.hive.udfs.lurlDecode';
create temporary function urlencode as 'com.levent.hive.udfs.lurlEncode';

com.levent.hive.udfs.lcrc32

  • takes a string input and returns crc32(long) value

com.levent.hive.udfs.ldays_between

  • calculates days difference between two dates and returns number of days(int) value

com.levent.hive.udfs.lmonths_between

  • calculates months difference between two dates and returns number of months(int) value

com.levent.hive.udfs.liLIKE

  • Hive ilike function in-case sensitive like between two strings returns boolean TRUE/FALSE

com.levent.hive.udfs.lurlDecode

  • URLDecode - decodes application/x-www-form-urlencoded type into string (UTF-8)

com.levent.hive.udfs.lurlEncode

  • URLEncode - encodes a string into application/x-www-form-urlencoded type (UTF-8)

About

Collection of my Scala Hive UDFs - Hive iLike, crc32, days_between,months_between

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages