当前位置:   article > 正文

hive实验_hive的实验一什么做

hive的实验一什么做
hadoop fs -ls /user/hive/warehouse


show databases;
use mydb;
show tables;
create table test1(id int,name string)partitioned by (dt string);


https://cwiki.apache.org/confluence/display/Hive/Tutorial


create table page_views
(
track_time string,
url string,
session_id string,
referer string,
ip string,
end_user_id string,
city_id string
) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';


hive -e "load data local inpath '/home/hadoop/page_views.dat'  OVERWRITE INTO TABLE  page_views;"


内部表(托管表)
Drop  
外边表(external )
默认分隔符:列 为 \001         行为 \n
分区表
Insert  overwrite  table  page…




CREATE TABLE page_view(viewTime INT, userid BIGINT,
                page_url STRING, referrer_url STRING,
                ip STRING COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY(dt STRING, country STRING)
ROW FORMAT DELIMITED
        FIELDS TERMINATED BY '1'
STORED AS SEQUENCEFILE;


select * 不会解析为mapreduce,是直接找hdfs文件
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/691842
推荐阅读
相关标签
  

闽ICP备14008679号