1、Impala Parquet 表 分区表
#parquet表
[hadoop02:21000] > create table parquet_ex_sms_event LIKE i_bil_hb_d.ex_sms_event stored as parquet;
Query: create table parquet_ex_sms_event LIKE i_bil_hb_d.ex_sms_event stored as parquet
[hadoop02:21000] > insert overwrite table parquet_ex_sms_event partition(date_no,area_code) select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691;
Query: insert overwrite table parquet_ex_sms_event partition(date_no,area_code) select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691
[hadoop02:21000] > select count(*) from parquet_ex_sms_event;
Query: select count(*) from parquet_ex_sms_event
+----------+
| count(*) |
+----------+
| 278678 |
+----------+
Fetched 1 row(s) in 0.58s
#普通表
[hadoop02:21000] > create table default_ex_sms_event as select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691;
Query: create table default_ex_sms_event as select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691
+------------------------+
| summary |
+------------------------+
| Inserted 278678 row(s) |
+------------------------+
Fetched 1 row(s) in 6.19s
[hadoop02:21000] > select count(*) from default_ex_sms_event;
Query: select count(*) from default_ex_sms_event
+----------+
| count(*) |
+----------+
| 278678 |
+----------+
Fetched 1 row(s) in 0.61s
#parquet表
[hadoop02:21000] > create table parquet_ex_sms_event LIKE i_bil_hb_d.ex_sms_event stored as parquet;
Query: create table parquet_ex_sms_event LIKE i_bil_hb_d.ex_sms_event stored as parquet
[hadoop02:21000] > insert overwrite table parquet_ex_sms_event partition(date_no,area_code) select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691;
Query: insert overwrite table parquet_ex_sms_event partition(date_no,area_code) select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691
[hadoop02:21000] > select count(*) from parquet_ex_sms_event;
Query: select count(*) from parquet_ex_sms_event
+----------+
| count(*) |
+----------+
| 278678 |
+----------+
Fetched 1 row(s) in 0.58s
#普通表
[hadoop02:21000] > create table default_ex_sms_event as select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691;
Query: create table default_ex_sms_event as select * from i_bil_hb_d.ex_sms_event where date_no=20141212 and area_code=0691
+------------------------+
| summary |
+------------------------+
| Inserted 278678 row(s) |
+------------------------+
Fetched 1 row(s) in 6.19s
[hadoop02:21000] > select count(*) from default_ex_sms_event;
Query: select count(*) from default_ex_sms_event
+----------+
| count(*) |
+----------+
| 278678 |
+----------+
Fetched 1 row(s) in 0.61s