zoukankan      html  css  js  c++  java
  • hive经常使用命令

    hive经常使用命令


    show tables;
    列出hive里面全部数据表名

    desc userProfile;
    显示数据表userProfile的基本表字段及字段type

    desc extended trackinfo;
    显示数据表trackinfo的具体信息,包含字段说明,数据表等

    /usr/local/cloud/hive/bin/hive
    进入hive数据库

    select attribute_name from pms_attribute where attribute_id=21000 and attribute_value_id=105991;
    hive的select操作

    select user_id, category_id, catgory_pref, attribute_id, attribute_pref, attribute_value_id, attribute_value_pref from userProfile limit 10;
    hive的select操作,仅仅显示10行

    /usr/local/cloud/hive/bin/hive -e "select category_id, attribute_id, count(user_id) from userProfile group by category_id, attribute_id" >> /home/deploy/recsys/workspace/ouyangyewei/statistics_data/number_attention_of_attribute_for_mobilePhone.csv;
    将sql查询的数据导出到csv文件里

    hiveFile sql文件名称
    运行sql文件(该命令在bash命令行上运行)
  • 相关阅读:
    bzoj1103[POI2007]大都市meg
    bzoj1098[POI2007]办公楼biu
    bzoj1102[POI2007]山峰和山谷Grz
    POI刷题记录
    语法-指针
    dp-最长公共子序列
    如何判断素数
    C++的map用法
    stl-优先队列
    C++和Java的stack语法
  • 原文地址:https://www.cnblogs.com/wzzkaifa/p/6764395.html
Copyright © 2011-2022 走看看