如何使用配置单元插入表选择函数查询

bq9c1y66  于 2021-06-01  发布在  Hadoop
关注(0)|答案(0)|浏览(178)

insert into table选择具有函数结果值的表时,不会显示该值。我该怎么办?
函数查询结果

hive> SELECT start_num,geoip(start_ip,'COUNTRY_CODE','/usr/local/hive/lib/GeoLite2-Country.mmdb') from geoip limit 3;
OK
17/05/24 18:02:15 INFO mapred.FileInputFormat: Total input files to process : 1
16778240        AU
16779264        CN
16781312        JP
Time taken: 0.129 seconds, Fetched: 3 row(s)

插入函数查询结果时

Query insert into table iptest2 SELECT start_num,geoip(start_ip,'COUNTRY_CODE','/usr/local/hive/lib/GeoLite2-Country.mmdb') from geoip limit3;

17/05/24 18:05:41 INFO mapred.FileInputFormat: Total input files to process : 2
16778240
16779264
16781312
Time taken: 0.115 seconds, Fetched: 3 row(s)

iptest2表格说明

hive> desc iptest2;
OK
17/05/25 09:26:28 INFO mapred.FileInputFormat: Total input files to process : 1
code                    string
ccode                   string
Time taken: 0.066 seconds, Fetched: 2 row(s)

)
geoip函数udf(使用下面链接中的udf函数)
https://github.com/spuul/hive-udfs/blob/master/src/main/java/com/spuul/hive/geoip2.java

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题