如何使用Hive插入表选择函数查询

时间:2017-05-24 09:07:36

标签: hadoop hive

插入表格当选择具有功能结果值的表格时,不会显示该值。我该怎么办?

  • 功能查询结果

    MongoDB Exception – yii\mongodb\Exception
    no such cmd: listCollections
    
    Caused by: MongoDB\Driver\Exception\RuntimeException
    no such cmd: listCollections
    
    in /var/www/html/advanced/vendor/yiisoft/yii2-mongodb/Command.php at line 187
    
  • 插入函数查询查询结果时

    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)
    
  • iptest2 table desc

    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)
    

    • GEOIP功能UDF(使用以下链接中的UDF功能)

https://github.com/Spuul/hive-udfs/blob/master/src/main/java/com/spuul/hive/GeoIP2.java

0 个答案:

没有答案
相关问题