1、打开IDEA中的C:\Users\jieqiong\IdeaProjects\hadoop-train-v2\input\etl\part-r-00000
2、创建外部表track_info
(1)依据上述IDEA中的ETL的结果,进行建表
(2)一般:日志是一天一个分区
hive (testzhang_db)> CREATE EXTERNAL TABLE track_info( > ip string, > country string, > province string, > url string, > page string > ) partitioned by (day string) > ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t‘ > location ‘/project/track_info‘;
3、查看外部表track_info
(1)首先外部表track_info为空
(2)其次name:day,表示分区
hive (testzhang_db)> select * from track_info; hive (testzhang_db)> desc formatted track_info;
hive (testzhang_db)> desc extended track_info;
Table Type: EXTERNAL_TABLE Table(tableName:track_info,.... FieldSchema(name:day, type:string,.....
(3)最后要通过ETL代码跑出结果后,再使用Hive进行相应处理。