Hive某字段空值用同组该字段非空值填充

时间:2024-04-10 20:39:52
select order_id, status_submit, status_audit from( select order_id ,coalesce(status_submit, last_value(status_submit) over (partition by order_id order by status_submitrows between unbounded preceding and unbounded following)) as status_submit ,coalesce(status_audit, last_value(status_audit) over (partition by order_id order by status_audit rows between unbounded preceding and unbounded following)) as status_audit from dbname.tableName )t group by order_id,status_submit,status_audit