• Hive2 beeline 使用方法


    Hive2 beeline
    –Beeline 要与HiveServer2配合使用,支持嵌入模式和远程模式
    –启动HiverServer2 ,./bin/hiveserver2
    –启动Beeline
    –wangyue@wangyue-um:~/opt/hive/hive-0.12.0-cdh5.1.0$ ./bin/beeline
    –beeline> !connect jdbc:hive2://localhost:10000
    –默认用户名、密码不验证
    •配置文件hive.server2.authentication默认为NONE
    下面的t 是必须的
    select * from (
    select imei,sum(drop_num) drop_num,sum(duration) duration,(sum(drop_num) / sum(duration)) AS dd from phone_detail group by imei  ) t  order by t.dd desc
    limit 10;


    +---------+-------------+-------------+------------------------+--+
    | t.imei  | t.drop_num  | t.duration  |          t.dd          |
    +---------+-------------+-------------+------------------------+--+
    | 639876  | 1           | 734         | 0.0013623978201634877  |
    | 356436  | 1           | 1028        | 9.727626459143969E-4   |
    | 351760  | 1           | 1232        | 8.116883116883117E-4   |
    | 368883  | 1           | 1448        | 6.906077348066298E-4   |
    | 358849  | 1           | 1469        | 6.807351940095302E-4   |
    | 358231  | 1           | 1613        | 6.199628022318661E-4   |
    | 863738  | 2           | 3343        | 5.982650314089142E-4   |
    | 865011  | 1           | 1864        | 5.36480686695279E-4    |
    | 862242  | 1           | 1913        | 5.227391531625719E-4   |
    | 350301  | 2           | 3998        | 5.002501250625312E-4   |
    +---------+-------------+-------------+------------------------+--+



    ***思想告诉我们,活着就要扯蛋,斗争




  • 相关阅读:
    升级ios 不能连原本的xcode /xcode不能抓帧/换xcode版本 build fail
    BlackBerry Key2 键盘扩展
    再议C风格变量声明
    怎样去除SVN中的某个版本之前的所有版本
    mysql 常用基础语句
    乱码问题
    sql server
    MySQL查询今天、昨天、上周、近30天、去年等的数据的方法
    java 时间转换
    sql server 日期
  • 原文地址:https://www.cnblogs.com/TendToBigData/p/10501442.html
Copyright © 2020-2023  润新知