项目作者: debjyoti385

项目描述 :
Apache Hive UDF (User Defined Functions)
高级语言: Java
项目地址: git://github.com/debjyoti385/HiveUDF.git
创建时间: 2015-01-14T09:09:38Z
项目社区:https://github.com/debjyoti385/HiveUDF

开源协议:

下载


Hive UDFs


UDFs

  • Aggregate UDF
    1. Finds MIN, MAX and SUM from array of Struct Objects based on a field.
  • Sort UDF

    1. Returns sorted array of Struct objects for an array of Struct Objects based on a field.
  • Date UDF (for Lookup on Date dimension, Data Warehousing concept)

    1. Returns date key field, e.g. __FUNC__('2014-04-05T01:30:34Z') ISO 8601 format, __FUNC__('2014-04-05 01:30:34') and __FUNC__(UNIX_TIMESTAMP('2014-04-05 01:30:34')) returns 20140405
  • Time UDF (for Lookup on Time dimension, Data Warehousing concept)

    1. Returns date key field, e.g. __FUNC__('2014-04-05T01:30:34Z') ISO 8601 format, __FUNC__('2014-04-05 01:30:34') and __FUNC__(UNIX_TIMESTAMP('2014-04-05 01:30:34')) returns 130
  • Contains UDF

    1. __FUNC__(List<String>, String)
    2. returns true or false accordingly.

Usage and execution:


  1. $ mvn package assembly:single
  2. $ hive
  3. hive> ADD JAR /path/to/hiveUDF-1.0-SNAPSHOT-jar-with-dependencies.jar;
  4. hive> CREATE TEMPORARY FUNCTION addHello as 'in.debjyotipaul.udf.HiveUDFSimpleSample';
  5. hive> SELECT addHello(name) from table;