Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

"UnsupportedOperationException" while executing geoip2 UDF

"UnsupportedOperationException" while executing geoip2 UDF

New Contributor

Hello,

I am experiencing the following situation:

I uploaded the compiled jar from https://github.com/Spuul/hive-udfs and the file GeoLite2-Country.mmdb from http://dev.maxmind.com/geoip/geoip2/geolite2/ to the HDFS. I have performed the steps as described in the README file of the project:

ADD JAR <hdfs_location>/hive-udf-0.1-SNAPSHOT.jar;
ADD FILE <hdfs_location>/GeoLite2-Country.mmdb;
CREATE TEMPORARY FUNCTION geoip as 'com.spuul.hive.GeoIP2';

All these commands return OK and execute with no problem. However, when I do this:

SELECT geoip('8.8.8.8', 'COUNTRY_NAME', './GeoLite2-Country.mmdb');

This query does not execute and returns the following error:

FAILED: UnsupportedOperationException ./GeoLite2-Country.mmdb (No such file or directory)

Does anyone know the cause of this problem?

Thanks in advance.

5 REPLIES 5

Re: "UnsupportedOperationException" while executing geoip2 UDF

Mentor

@Telma Fernandes try to refer to the .mmdb file either by removing "./" or full path 'hdfs://fqdn:8020/path/file.mmdb

Re: "UnsupportedOperationException" while executing geoip2 UDF

New Contributor
@Artem Ervits

I already tried that, but it gave the same error.

Re: "UnsupportedOperationException" while executing geoip2 UDF

Mentor

did you upload the file to hdfs? @Telma Fernandes

hdfs dfs -put file.mmdb /user/username/

Re: "UnsupportedOperationException" while executing geoip2 UDF

New Contributor

@Artem Ervits

I uploaded both file and jar through the Files View via ambari and changed the permissions of each one to 777.

Re: "UnsupportedOperationException" while executing geoip2 UDF

Mentor

@Telma Fernandes try with beeline if you did that with hive shell before or vice versa.

Don't have an account?
Coming from Hortonworks? Activate your account here