首页 > 代码库 > 【云计算】impala建表,文件关联,查询
【云计算】impala建表,文件关联,查询
[cloudil@hadoop164 caixianfeng]$ hdfs dfs -mkdir -p /csv-pig/tab1 /csv-pig/tab1
tab1.csv:
1,true,123.123,2012-10-24 08:55:00 2,false,1243.5,2012-10-25 13:40:003,false,24453.325,2008-08-22 09:33:21.1234,false,243423.325,2007-05-12 22:32:21.334545,true,243.325,1953-04-22 09:11:33
[cloudil@hadoop164 caixianfeng]$ hdfs dfs -put tab1.csv /csv-pig/tab1
DROP TABLE IF EXISTS tab1;
-- The EXTERNAL clause means the data is located outside the central location for Impala data files
-- and is preserved when the associated Impala table is dropped. We expect the data to already
-- exist in the directory specified by the LOCATION clause.
CREATE EXTERNAL TABLE tab1
(
id INT,
col_1 BOOLEAN,
col_2 DOUBLE,
col_3 TIMESTAMP
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,‘
LOCATION ‘/csv-pig/tab1‘;
impala-shell -i 172.16.230.152 -f table_setup.sql
【云计算】impala建表,文件关联,查询
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。