public Object evaluate(DeferredObject[] arguments) throws HiveException {
System.out.println("evluate1");
// 获取参数
LazyString p1 = (LazyString) arguments[0].get();
System.out.println("evluate2");
执行:
select ip from nginx_log_avro1 limit 3;
OK
ip
23.89.251.234
42.236.10.108
42.236.10.121
Time taken: 1.042 seconds, Fetched: 3 row(s)
hive (db1)>
> select iptrans(ip) from nginx_log_avro1;
OK
c0
evluate1
-- evluate2未输出
Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating 该函数可以帮助你返回ip物理地址名称,每次传入一个ip地址
Time taken: 0.646 seconds