Code Monkey home page Code Monkey logo

hive_udfs's Introduction

hive_udfs

This udf package can be used with our impala udfs, which can be found here.

Methods

All methods are in the package: hive_udfs

Hash

UDFMD5  (arg:String) -> String (Hex)
UDFSHA1 (arg:String) -> String (Hex)
UDFSHA2 (arg:String) -> String (Hex)

Key Generation

UDFKeyGen128 (arg:id) -> String (Hex)
UDFKeyGen256 (arg:id) -> String (Hex)

Pass an id, to ensure different results for each call. Otherwise hive is not able to reset the salt.

Encryption/Decryption using AES/CBC/PKCS5Padding

arg: Text to encrypt/decrypt, arg1: password or key in hex

UDFAES128Encrypt (arg:String, arg1:String (Hex) ) -> String (Hex)
UDFAES128Decrypt (arg:String, arg1:String (Hex) ) -> primitive type
UDFAES256Encrypt (arg:String, arg1:String (Hex) ) -> String (Hex)
UDFAES256Decrypt (arg:String, arg1:String (Hex) ) -> primitive type

Development

Download the Java JCA Jar and add it via external Jar to the project. Download the necessary Hadoop/Hive Jars and add it via external JAR to your project.

Upload the UDFs

  1. Create a JAR from the UDFS package.
  2. Upload the JAR f.e. via SCP to the cluster
scp -r -P2222 <path>/<udf.jar> <user>@<address>:/<path>
  1. Register the JAR to the class path via hive shell
ADD JAR <path>/<udf.jar>;
  1. The registered JAR should be visible via:
LIST JARS;
  1. Create a function from the regisitered JAR.
CREATE TEMPORARY FUNCTION <alias> AS '<package>.<method>';
  1. After you can test your functions as usual:
SELECT encaes128("scalefree.com",hex("secret"));

hive_udfs's People

Contributors

jcoeln avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.