hive表删除数据不能使用delete from table_name 的SQL语句,

一。删除分区部分数据

insert overwrite  table 02_logical_layer_007_h_lf_cw.finance_tax_bill partition(importdate='20220218')
select
bill_id ,
apply_emp_id ,
bill_type_name ,
apply_emp_name ,
reimbursement_name ,
bill_apply_date ,
check_amount ,
appr_org_sfname ,
bill_beg_date ,
bill_end_date ,
bill_code ,
jzpz ,
jzpz_yz ,
company_old_code ,
account_period ,
finance_number ,
profit_center ,
doc_date ,
cart_head ,
pstng_date ,
g0qykjkm ,
jzpz_tax ,
jzpz_tax_yz
from
02_logical_layer_007_h_lf_cw.finance_tax_bill where importdate='20220218' and pstng_date='20220218';

注意:select后面不能使用*

二、删除分区全部数据

ALTER TABLE 02_logical_layer_007_h_lf_cw.finance_travel_analysis drop PARTITION (importdate='20220218')