use testdb;INSERT OVERWRITE TABLE biz_data_count_debugselect method,biz_data,count(1) as count,max(timestamp) as timestampfrom (select * from qa_log_debug where method is not null and method!='N/A' and timestamp>${hivevar:maxTimestamp}) my_debuggroup by method,biz_data;