zoukankan      html  css  js  c++  java
  • hive基本操作与应用

    启动hadoop

    start-all.sh
    jps
    

      

    Hdfs上创建文件夹

    hdfs dfs -mkdir wcinput
    hdfs dfs -ls /user/hadoop
    

      

    上传文件至hdfs

      先将文件放在wc文件夹中,我存放的是try.txt

      然后文件上传到hdfs

    hdfs dfs -put ./try.txt wcinput
    hdfs dfs -ls /user/hadoop/wcinput
    

      

      

    启动Hive

    hive
    

      

    创建原始文档表

    create table docs(long string);
    

      

      

    导入文件内容到表docs并查看

    load data inpath '/user/hadoop/wcinput/try.txt' overwrite into table docs;
    

     

    select * from docs;
    

      

    用HQL进行词频统计,结果放在表word_count里

     

    查看统计结果

    转载于:https://www.cnblogs.com/zhiling123/p/9042124.html

  • 相关阅读:
    C#Webform 控件
    C#Webform
    MVC Razor 语法
    input file 添加
    ajax
    jquery动画
    jquery选择器,事件 dom操作
    linq 复杂查询
    webform(linq增删改查)
    asp.net内置对象
  • 原文地址:https://www.cnblogs.com/twodog/p/12136893.html
Copyright © 2011-2022 走看看