Spuul / hive-udfs

Collection of Hive UDFs
5 stars 11 forks source link

UDF gives IOException after 63 ips #2

Closed kapateldhruv closed 8 years ago

kapateldhruv commented 8 years ago

I've 30k+ ips in my hive table. I am using lite free databases. UDF successfully executes till 63 rows.

When i try to execute with ip of 64th row. SELECT geoip('64.233.173.231','COUNTRY_CODE','/home/dhruv/hive_loganalysis_udf_jars/GeoLite2-City.mmdb'); returns FAILED: UnsupportedOperationException null

DanielMuller commented 8 years ago

The IP 64.233.173.231 has no country associated. This kind of response needs to be handled.

kapateldhruv commented 8 years ago

:+1: I think its better to return unknown instead of empty string. What do you think?

DanielMuller commented 8 years ago

"Unknown" works well when requested value is a country name. When requesting a country code, you expect a 2 char string. I would rather go for "-" or "--" if empty string is an issue.

kapateldhruv commented 8 years ago

Yeah right. No issue with an empty string.