zoukankan      html  css  js  c++  java
  • Hive_hdfs导入csv文件

    转自:Hive_hdfs csv导入hive demo

     

    1 create csv file.
    student.csv

    4,Rose,M,78,77,76
    5,Mike,F,99,98,98

    2 put it to hdfs.

    # hdfs dfs -put student.csv /input

    3 create table in hive.

    create table student_csv
    (sid int, sname string, gender string, language int, math int, english int)
    row format delimited fields terminated by ',' stored as textfile;

    4 load hdfs file to hive.

    load data inpath '/input/student.csv' into table student_csv;

    5 verify.

    hive> select * from student_csv;
    OK
    4 Rose M 78 77 76
    5 Mike F 99 98 98
  • 相关阅读:
    mysql
    mysql
    mysql
    mysql
    sed编辑命令
    awk正则应用
    awk运算符
    awk命令细节
    uniq命令
    sort命令
  • 原文地址:https://www.cnblogs.com/feiquan/p/11288403.html
Copyright © 2011-2022 走看看