Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 2.33 KB

README.md

File metadata and controls

44 lines (37 loc) · 2.33 KB

HIVE UDF

Credits

Modifed from https://github.com/petrabarus/HiveUDFs

Compiling

This project uses Maven, compile it with:

mvn package

Functions

GeoIP2

GeoIP2 uses MaxMinds GeoIP2 Database to retrieve informations from an IP Address. Any V2 database can be used, paid or lite.

Usage:

ADD JAR hive-udf.jar;
ADD FILE GeoIP2-Country.mmdb;
CREATE TEMPORARY FUNCTION geoip as 'com.spuul.hive.GeoIP2';
SELECT geoip('8.8.8.8','COUNTRY_NAME','./GeoIP2-Country.mmdb');

####FUNC(String ip, String dataType, String databasePath)

dataType

Allows you to retrive a specific information from the database. The wanted information needs to be available in the used database. You can't retrieve an city information from a country database.