school_records
year
WHERE
YEAR=1966
YEARIN(1989,1999)
YEARBETWEEN1984AND1989
SELECTCOUNT(*)FROMschool_recordsWHEREyear=1985
SELECTCOUNT(*)FROMschool_records
Male
Female
CREATETABLE
PARTITIONEDBY
PARTITIONEDBY
CREATETABLEASSELECT
ALTERTABLE
ALTERTABLE
ADDPARTITION
LOCATION
ADDPARTITION
SETLOCATION
INSERT
INSERTOVERWRITE
INSERT
impala
‑‑insert_inherit_permissions
SELECT
查询的分区修剪SHOWPARTITIONS
SHOW声明ALTERTABLE
INSERT
insertintot1partition(x=10,y='a')selectc1fromsome_other_table;
INSERT
insertintot1partition(x,y='b')selectc1,c2fromsome_other_table;
--Createnewpartitionifnecessarybasedonvariableyear,month,andday;insertasinglevalue.
insertintoweatherpartition(year,month,day)select'cloudy',2014,4,21;
--Createnewpartitionifnecessaryforspecifiedyearandmonthbutvariableday;insertasinglevalue.
insertintoweatherpartition(year=2014,month=04,day)select'sunny',22;
PARTITION
SELECT
SELECT
REFRESH
REFRESH
REFRESH
REFRESH语句PARTITION(partition_spec)REFRESHREFRESHbig_tablePARTITION(year=2017,month=9,day=30)REFRESH
INSERT
impala
‑‑insert_inherit_permissions
YEAR
MONTH
DAY
WHERE
WHEREyear=2013
WHEREyear<2010
WHEREyearBETWEEN1995AND1998
WHEREyear=2013ANDmonthBETWEEN1AND3
EXPLAIN
#partitions=1/3
EXPLAIN
[localhost:21000]>insertintocensuspartition(year=2010)values('Smith'),('Jones');
[localhost:21000]>insertintocensuspartition(year=2011)values('Smith'),('Jones'),('Doe');
[localhost:21000]>insertintocensuspartition(year=2012)values('Smith'),('Doe');
[localhost:21000]>selectnamefromcensuswhereyear=2010;
+-------+
|name|
+-------+
|Smith|
|Jones|
+-------+
[localhost:21000]>explainselectnamefromcensuswhereyear=2010;
+------------------------------------------------------------------+
|ExplainString|
+------------------------------------------------------------------+
|PLANFRAGMENT0|
|PARTITION:UNPARTITIONED|
||
|1:EXCHANGE|
||
|PLANFRAGMENT1|
|PARTITION:RANDOM|
||
|STREAMDATASINK|
|EXCHANGEID:1|
|UNPARTITIONED|
||
|0:SCANHDFS|
|table=predicate_propagation.census#partitions=1/3size=12B|
+------------------------------------------------------------------+
SUMMARY
PROFILE