zoukankan      html  css  js  c++  java
  • Hadoop综合大作业

    Hadoop综合大作业 要求:

    1.用Hive对爬虫大作业产生的文本文件(或者英文词频统计下载的英文长篇小说)进行词频统计。

    我下载的是一篇英文长篇小说《教父》,字数为个,

     

    将文章(godfather.txt)放在了wc文件中:

    启动hadoop:

    start-all.sh
    jps
    

      

    文件上传至hdfs

    hdfs dfs -put ./godfather.txt /bigdatacase/dataset
    hdfs dfs -ls /bigdatacase/dataset
    

      

    启动hive

     hive

    创建原始文档表

    create table novel(long string);
    

      

    导入文件内容到表novel

     
    load data inpath '/bigdatacase/dataset/godfather.txt' overwrite into table novel;
    

      

    进行词频统计并放入表novelcount表中

     
    create table novelcount as select word,count(1) from (select(long,' ')) as word from novel) word group by word;
    

      

    查看统计结果(前20个)

     
    select * from novelcount limit 20
    

      

  • 相关阅读:
    Java基础-3y
    对线面试官面试系列-3y
    从零单排学Redis【青铜】
    mock官方文档
    route路由组件传递参数
    axios拦截器与vue代理设置
    Sass使用方法
    Less使用方法
    Vue-cli
    Vue-组件注册
  • 原文地址:https://www.cnblogs.com/piglet00/p/9082649.html
Copyright © 2011-2022 走看看