1.建完分区表之后,向表中导入数据
命令为:
load data local inpath '/home/admin/Desktop/2015082818' into table db_web_data.track_log partition(data='20150828',hour='18');
2.错误类型提醒
FAILED: SemanticException Partition spec {data=20150828, hour=18} contains non-partition columns
3.原因是导入数据时,字段写成了data string 应该是date string
建表命令
create table if not exists db_web_data.track_log( id string, url string, referer string, keyword string, type string, guid string, pageId string, moduleId string, linkId string, attachedInfo string, sessionId string, trackerU string, trackerType string, ip string, trackerSrc string, cookie string, orderCode string, trackTime string, endUserId string, firstLink string, sessionViewNo string, productId string, curMerchantId string, provinceId string, cityId string, fee string, edmActivity string, edmEmail string, edmJobId string, ieVersion string, platform string, internalKeyword string, resultSum string, currentPage string, linkPosition string, buttonPosition string ) partitioned by (date string,hour string) row format delimited fields terminated by ' ';