Hive表:
create table if not exists employee3(
name string comment 'employee name',
salary float comment 'employee salary',
subordinates array<string> comment 'names of subordinates',
deductions map<string,float> comment 'keys are deductions values are percentages',
address struct<street:string, city:string, state:string, zip:int> comment 'home address'
)
PARTITIONED BY (country string, state string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
load data:
LOAD DATA LOCAL INPATH '/home/xiaosi/hive/input/employeeData.txt'
OVERWRITE INTO TABLE employee3
PARTITION (country='China',state='BeiJing');
错误:
Failed with exception org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter partition. For direct MetaStore DB connections, we don't support retries at the client level.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask