当sql过长过复杂时, 比如一个sql格式化后2万行, 2MB大小, 在解析时会导致FE FULL GC卡死

内存都被Antlr占了, 怀疑存在内存泄露.
FE上执行sql无响应超时, 很奇怪FE没有OOM, 就是一直GC所有sql阻塞, 还不如OOM

antlr 有个clearDFA() 方法, 不知道能不能解决这个问题.

有些sql嵌套层数很多 我贴一个局部吧

"select cast(\"channel_1c4\" as VARCHAR) as \"channel_1c4\", cast(\"_time_dynamic_pay_time_1c4\" as TIMESTAMP) as \"_time_dynamic_pay_time_1c4\", cast(\"shop_name_1c4\" as VARCHAR) as \"shop_name_1c4\", cast(\"category_mne\" as VARCHAR) as \"category_mNe\", cast(\"product_id_1c4\" as VARCHAR) as \"product_id_1c4\", cast(\"xsyf_tot\" as double) as \"xsyf_TOT\", cast(\"xszkje_zul\" as double) as \"xszkje_ZuL\", cast(\"xsje_sff\" as double) as \"xsje_Sff\", cast(\"xssr_buf\" as double) as \"xssr_bUF\", cast(\"shje_13n\" as double) as \"shje_13N\", cast(\"xssrbhtk_4ea\" as double) as \"xssrbhtk_4ea\", cast(\"shbcb_f7x\" as double) as \"shbcb_f7x\", cast(\"xsbcb_pi5\" as double) as \"xsbcb_PI5\", cast(\"ywcb_9w3\" as double) as \"ywcb_9W3\", cast(\"ywmlr_1gb\" as double) as \"ywmlr_1GB\", cast(\"shje_ud5\" as double) as \"shje_UD5\", cast(\"xsyf_eli\" as double) as \"xsyf_Eli\", cast(\"xszkje_ewv\" as double) as \"xszkje_eWv\", cast(\"xsje_eif\" as double) as \"xsje_EIf\", cast(\"xssr_89n\" as double) as \"xssr_89N\", cast(\"shje_xjz\" as double) as \"shje_xJz\", cast(\"xssrbhtk_dqh\" as double) as \"xssrbhtk_Dqh\", cast(\"shbcb_kx0\" as double) as \"shbcb_kx0\", cast(\"xsbcb_yyj\" as double) as \"xsbcb_YYj\", cast(\"ywcb_gsa\" as double) as \"ywcb_GsA\", cast(\"ywmlr_asc\" as double) as \"ywmlr_aSc\", cast(\"ship_insurance_fee_ft_cwo\" as double) as \"ship_insurance_fee_ft_cWO\", cast(\"platform_fix_deduc_fee_ft_yck\" as double) as \"platform_fix_deduc_fee_ft_Yck\", cast(\"platform_commission_fee_ft_rzf\" as double) as \"platform_commission_fee_ft_RZf\", cast(\"market_act_fee_ft_6mr\" as double) as \"market_act_fee_ft_6mr\", cast(\"small_pay_fee_ft_1xx\" as double) as \"small_pay_fee_ft_1xx\", cast(\"influence_commission_fee_ft_fgp\" as double) as \"influence_commission_fee_ft_FGp\", cast(\"platform_other_settle_fee_ft_e81\" as double) as \"platform_other_settle_fee_ft_e81\", cast(\"zdfy_ft_gv4\" as double) as \"zdfy_ft_GV4\", cast(\"jlqc_basic_fee_ft_ffa\" as double) as \"jlqc_basic_fee_ft_Ffa\", cast(\"jlqc_uni_fee_ft_gk7\" as double) as \"jlqc_uni_fee_ft_Gk7\", cast(\"jzt_total_site_fee_ft_2sj\" as double) as \"jzt_total_site_fee_ft_2sJ\", cast(\"jzt_search_fee_ft_d6n\" as double) as \"jzt_search_fee_ft_D6n\", cast(\"wxt_fee_ft_ou4\" as double) as \"wxt_fee_ft_ou4\", cast(\"jzt_intelligent_fee_ft_9lo\" as double) as \"jzt_intelligent_fee_ft_9lo\", cast(\"ggtfhf_ft_cny\" as double) as \"ggtfhf_ft_cNY\", cast(\"qdfy_ft_ji3\" as double) as \"qdfy_ft_ji3\", cast(\"ywlr_ft_8qy\" as double) as \"ywlr_ft_8qY\", cast(\"ship_insurance_fee_ft_ibq\" as double) as \"ship_insurance_fee_ft_Ibq\", cast(\"platform_fix_deduc_fee_ft_wmy\" as double) as \"platform_fix_deduc_fee_ft_wmy\", cast(\"platform_commission_fee_ft_qzk\" as double) as \"platform_commission_fee_ft_QZk\", cast(\"market_act_fee_ft_27z\" as double) as \"market_act_fee_ft_27z\", cast(\"small_pay_fee_ft_6qv\" as double) as \"small_pay_fee_ft_6QV\", cast(\"influence_commission_fee_ft_id2\" as double) as \"influence_commission_fee_ft_id2\", cast(\"platform_other_settle_fee_ft_h4y\" as double) as \"platform_other_settle_fee_ft_H4Y\", cast(\"zdfy_ft_dvv\" as double) as \"zdfy_ft_dVv\", cast(\"jlqc_basic_fee_ft_pu7\" as double) as \"jlqc_basic_fee_ft_pu7\", cast(\"jlqc_uni_fee_ft_ldh\" as double) as \"jlqc_uni_fee_ft_LdH\", cast(\"jzt_total_site_fee_ft_ijo\" as double) as \"jzt_total_site_fee_ft_IJo\", cast(\"jzt_search_fee_ft_3lr\" as double) as \"jzt_search_fee_ft_3lR\", cast(\"wxt_fee_ft_lk8\" as double) as \"wxt_fee_ft_lK8\", cast(\"jzt_intelligent_fee_ft_dct\" as double) as \"jzt_intelligent_fee_ft_DCt\", cast(\"ggtfhf_ft_kvy\" as double) as \"ggtfhf_ft_Kvy\", cast(\"qdfy_ft_la5\" as double) as \"qdfy_ft_La5\", cast(\"xsyf_2re\" as double) as \"xsyf_2rE\", cast(\"xszkje_3l6\" as double) as \"xszkje_3L6\", cast(\"xsje_p67\" as double) as \"xsje_P67\", cast(\"xssr_mnk\" as double) as \"xssr_MnK\", cast(\"jlqc_basic_fee_ft_z04\" as double) as \"jlqc_basic_fee_ft_Z04\", cast(\"jlqc_uni_fee_ft_z7b\" as double) as \"jlqc_uni_fee_ft_z7b\", cast(\"jzt_total_site_fee_ft_ash\" as double) as \"jzt_total_site_fee_ft_asH\", cast(\"jzt_search_fee_ft_pdh\" as double) as \"jzt_search_fee_ft_pdH\", cast(\"wxt_fee_ft_ebk\" as double) as \"wxt_fee_ft_Ebk\", cast(\"jzt_intelligent_fee_ft_atd\" as double) as \"jzt_intelligent_fee_ft_atD\", cast(\"ggtfhf_ft_0io\" as double) as \"ggtfhf_ft_0io\", cast(\"xsyf_c79\" as double) as \"xsyf_c79\", cast(\"xszkje_xqj\" as double) as \"xszkje_xqJ\", cast(\"xsje_qma\" as double) as \"xsje_qMA\", cast(\"xssr_ed6\" as double) as \"xssr_ED6\", cast(\"shje_r5w\" as double) as \"shje_r5W\", cast(\"xssrbhtk_hol\" as double) as \"xssrbhtk_hol\", cast(\"shbcb_cam\" as double) as \"shbcb_CAm\", cast(\"xsbcb_8dp\" as double) as \"xsbcb_8Dp\", cast(\"ywcb_n25\" as double) as \"ywcb_n25\", cast(\"xsyf_7f9\" as double) as \"xsyf_7f9\", cast(\"xszkje_mmq\" as double) as \"xszkje_Mmq\", cast(\"xsje_yz4\" as double) as \"xsje_yz4\", cast(\"xssr_v1u\" as double) as \"xssr_v1u\", cast(\"shje_iu6\" as double) as \"shje_iU6\", cast(\"xssrbhtk_fcd\" as double) as \"xssrbhtk_fCd\", cast(\"xsyf_kqe\" as double) as \"xsyf_kQE\", cast(\"xszkje_7nk\" as double) as \"xszkje_7Nk\", cast(\"xsje_ati\" as double) as \"xsje_Ati\", cast(\"xssr_svq\" as double) as \"xssr_Svq\", cast(\"shje_ewl\" as double) as \"shje_EWL\", cast(\"xssrbhtk_bnb\" as double) as \"xssrbhtk_bNB\", cast(\"shbcb_ozw\" as double) as \"shbcb_ozw\", cast(\"xsbcb_o25\" as double) as \"xsbcb_O25\", cast(\"ywcb_1bn\" as double) as \"ywcb_1BN\", cast(\"ywmlr_kai\" as double) as \"ywmlr_KAI\", cast(\"ywmll_frn\" as double) as \"ywmll_frN\", cast(\"xsyf_hqf\" as double) as \"xsyf_hQf\", cast(\"xszkje_foo\" as double) as \"xszkje_FoO\", cast(\"xsje_muu\" as double) as \"xsje_MuU\", cast(\"xssr_mcm\" as double) as \"xssr_McM\", cast(\"shje_onn\" as double) as \"shje_OnN\", cast(\"xssrbhtk_oet\" as double) as \"xssrbhtk_oet\", cast(\"xsyf_dtm\" as double) as \"xsyf_Dtm\", cast(\"xszkje_lvw\" as double) as \"xszkje_LVw\", cast(\"xsje_psy\" as double) as \"xsje_psY\", cast(\"xssr_pr3\" as double) as \"xssr_PR3\", cast(\"shje_jdo\" as double) as \"shje_JDO\", cast(\"xssrbhtk_odh\" as double) as \"xssrbhtk_Odh\", cast(\"shbcb_7ec\" as double) as \"shbcb_7eC\", cast(\"xsbcb_x7o\" as double) as \"xsbcb_X7o\", cast(\"ywcb_2np\" as double) as \"ywcb_2NP\", cast(\"ywmlr_cnc\" as double) as \"ywmlr_CnC\", cast(\"ship_insurance_fee_ft_udw\" as double) as \"ship_insurance_fee_ft_udW\", cast(\"platform_fix_deduc_fee_ft_woq\" as double) as \"platform_fix_deduc_fee_ft_wOQ\", cast(\"platform_commission_fee_ft_he2\" as double) as \"platform_commission_fee_ft_he2\", cast(\"market_act_fee_ft_pwm\" as double) as \"market_act_fee_ft_pwm\", cast(\"small_pay_fee_ft_s8e\" as double) as \"small_pay_fee_ft_S8E\", cast(\"influence_commission_fee_ft_oeo\" as double) as \"influence_commission_fee_ft_OeO\", cast(\"platform_other_settle_fee_ft_yc3\" as double) as \"platform_other_settle_fee_ft_YC3\", cast(\"zdfy_ft_dum\" as double) as \"zdfy_ft_Dum\", cast(\"jlqc_basic_fee_ft_rav\" as double) as \"jlqc_basic_fee_ft_raV\", cast(\"jlqc_uni_fee_ft_cbd\" as double) as \"jlqc_uni_fee_ft_cbD\", cast(\"jzt_total_site_fee_ft_uns\" as double) as \"jzt_total_site_fee_ft_uns\", cast(\"jzt_search_fee_ft_r2h\" as double) as \"jzt_search_fee_ft_R2H\", cast(\"wxt_fee_ft_cxc\" as double) as \"wxt_fee_ft_cXC\", cast(\"jzt_intelligent_fee_ft_fvh\" as double) as \"jzt_intelligent_fee_ft_FvH\", cast(\"ggtfhf_ft_hm2\" as double) as \"ggtfhf_ft_hM2\", cast(\"qdfy_ft_wsi\" as double) as \"qdfy_ft_WSi\", cast(\"ywlr_ft_i0w\" as double) as \"ywlr_ft_I0w\", cast(\"ywlrl_ft_uqy\" as double) as \"ywlrl_ft_UqY\", cast(\"ship_insurance_fee_ft_ecl\" as double) as \"ship_insurance_fee_ft_eCL\", cast(\"platform_fix_deduc_fee_ft_9z0\" as double) as \"platform_fix_deduc_fee_ft_9z0\", cast(\"platform_commission_fee_ft_pjm\" as double) as \"platform_commission_fee_ft_pJM\", cast(\"market_act_fee_ft_ujf\" as double) as \"market_act_fee_ft_Ujf\", cast(\"small_pay_fee_ft_fxd\" as double) as \"small_pay_fee_ft_fXd\", cast(\"influence_commission_fee_ft_ozl\" as double) as \"influence_commission_fee_ft_oZl\", cast(\"platform_other_settle_fee_ft_uhh\" as double) as \"platform_other_settle_fee_ft_uHH\", cast(\"zdfy_ft_rnr\" as double) as \"zdfy_ft_rNR\" from (with a as (with a as (select \"data_source\", \"product_type\", \"product_id\", \"spec_id\", \"suite_code\", \"suite_name\", \"suite_spec_code\", \"suite_spec_name\", \"product_code\", \"product_name\", \"spec_code\", \"spec_name\", \"company\", \"channel\", \"shop_code\", \"shop_name\", \"brand\", \"category\", \"series\", \"unit\", cast(\"num\" as double) as \"num\", cast(\"weight\" as double) as \"weight\", \"pic\", cast(\"cost_price\" as double) as \"cost_price\", cast(\"virtual_cost_price\" as double) as \"virtual_cost_price\", to_timestamp(\"listing_time\") as \"listing_time\", \"product_lifecycle\", \"age_group\", \"stock_class\", \"is_best_sell\", \"is_potential\", \"is_profit\", \"is_inv_back\", \"is_high_aftersale\", \"self_opt_mode\", \"self_opt_type\" from \"nc_dev\".\"dim_product_spec\"), \n" +
      "b as (select \"product_name\" as \"product_name_mNe\", cast(null as double) as \"add_purchase_num_mNe\", cast(null as double) as \"add_purchase_people_mNe\", cast(null as double) as \"add_wish_list_people_mNe\", \"age_group\" as \"age_group_mNe\", \"brand\" as \"brand_mNe\", \"category\" as \"category_mNe\", \"channel\" as \"channel_mNe\", \"company\" as \"company_mNe\", cast(\"cost_price\" as double) as \"cost_price_mNe\", \"data_source\" as \"data_source_mNe\", \"is_best_sell\" as \"is_best_sell_mNe\", cast(null as VARCHAR) as \"is_channel_product_mNe\", \"is_high_aftersale\" as \"is_high_aftersale_mNe\", \"is_inv_back\" as \"is_inv_back_mNe\", \"is_potential\" as \"is_potential_mNe\", \"is_profit\" as \"is_profit_mNe\", to_timestamp(\"listing_time\") as \"listing_time_mNe\", cast(\"num\" as double) as \"num_mNe\", cast(null as double) as \"number_of_successfully_refunded_buyers_mNe\", cast(null as double) as \"number_of_successfully_refunded_orders_mNe\", cast(null as double) as \"pay_amout_mNe\", cast(null as double) as \"pay_buyers_mNe\", cast(null as double) as \"pay_items_mNe\", cast(null as double) as \"payment_order_num_mNe\", \"pic\" as \"pic_mNe\", cast(null as VARCHAR) as \"product_category_mNe\", \"product_code\" as \"product_code_mNe\", \"product_id\" as \"product_id_mNe\", \"product_lifecycle\" as \"product_lifecycle_mNe\", \"product_type\" as \"product_type_mNe\", cast(null as double) as \"product_views_mNe\", cast(null as double) as \"product_visitors_num_mNe\", cast(null as VARCHAR) as \"secondary_category_mNe\", \"self_opt_mode\" as \"self_opt_mode_mNe\", \"self_opt_type\" as \"self_opt_type_mNe\", \"series\" as \"series_mNe\", \"shop_code\" as \"shop_code_mNe\", \"shop_name\" as \"shop_name_mNe\", \"spec_code\" as \"spec_code_mNe\", \"spec_id\" as \"spec_id_mNe\", \"spec_name\" as \"spec_name_mNe\", cast(null as TIMESTAMP) as \"stat_date_mNe\", \"stock_class\" as \"stock_class_mNe\", cast(null as double) as \"suc_refund_amout_mNe\", \"suite_code\" as \"suite_code_mNe\", \"suite_name\" as \"suite_name_mNe\", \"suite_spec_code\" as \"suite_spec_code_mNe\", \"suite_spec_name\" as \"suite_spec_name_mNe\", \"unit\" as \"unit_mNe\", cast(\"virtual_cost_price\" as double) as \"virtual_cost_price_mNe\", cast(\"weight\" as double) as \"weight_mNe\" from a), \n" +
      "c as (select cast(\"b\".\"product_name_mNe\" as varchar) as \"product_name_mNe\", cast(\"b\".\"add_purchase_num_mNe\" as double) as \"add_purchase_num_mNe\", cast(\"b\".\"add_purchase_people_mNe\" as double) as \"add_purchase_people_mNe\", cast(\"b\".\"add_wish_list_people_mNe\" as double) as \"add_wish_list_people_mNe\", cast(\"b\".\"age_group_mNe\" as varchar) as \"age_group_mNe\", cast(\"b\".\"brand_mNe\" as varchar) as \"brand_mNe\", cast(\"b\".\"category_mNe\" as varchar) as \"category_mNe\", cast(\"b\".\"channel_mNe\" as varchar) as \"channel_mNe\", cast(\"b\".\"company_mNe\" as varchar) as \"company_mNe\", cast(\"b\".\"cost_price_mNe\" as double) as \"cost_price_mNe\", cast(\"b\".\"data_source_mNe\" as varchar) as \"data_source_mNe\", cast(\"b\".\"is_best_sell_mNe\" as varchar) as \"is_best_sell_mNe\", cast(\"b\".\"is_channel_product_mNe\" as varchar) as \"is_channel_product_mNe\", cast(\"b\".\"is_high_aftersale_mNe\" as varchar) as \"is_high_aftersale_mNe\", cast(\"b\".\"is_inv_back_mNe\" as varchar) as \"is_inv_back_mNe\", cast(\"b\".\"is_potential_mNe\" as varchar) as \"is_potential_mNe\", cast(\"b\".\"is_profit_mNe\" as varchar) as \"is_profit_mNe\", to_timestamp(\"b\".\"listing_time_mNe\") as \"listing_time_mNe\", cast(\"b\".\"num_mNe\" as double) as \"num_mNe\", cast(\"b\".\"number_of_successfully_refunded_buyers_mNe\" as double) as \"number_of_successfully_refunded_buyers_mNe\", cast(\"b\".\"number_of_successfully_refunded_orders_mNe\" as double) as \"number_of_successfully_refunded_orders_mNe\", cast(\"b\".\"pay_amout_mNe\" as double) as \"pay_amout_mNe\", cast(\"b\".\"pay_buyers_mNe\" as double) as \"pay_buyers_mNe\", cast(\"b\".\"pay_items_mNe\" as double) as \"pay_items_mNe\", cast(\"b\".\"payment_order_num_mNe\" as double) as \"payment_order_num_mNe\", cast(\"b\".\"pic_mNe\" as varchar) as \"pic_mNe\", cast(\"b\".\"product_category_mNe\" as varchar) as \"product_category_mNe\", cast(\"b\".\"product_code_mNe\" as varchar) as \"product_code_mNe\", cast(\"b\".\"product_id_mNe\" as varchar) as \"product_id_mNe\", cast(\"b\".\"product_lifecycle_mNe\" as varchar) as \"product_lifecycle_mNe\", cast(\"b\".\"product_type_mNe\" as varchar) as \"product_type_mNe\", cast(\"b\".\"product_views_mNe\" as double) as \"product_views_mNe\", cast(\"b\".\"product_visitors_num_mNe\" as double) as \"product_visitors_num_mNe\", cast(\"b\".\"secondary_category_mNe\" as varchar) as \"secondary_category_mNe\", cast(\"b\".\"self_opt_mode_mNe\" as varchar) as \"self_opt_mode_mNe\", cast(\"b\".\"self_opt_type_mNe\" as varchar) as \"self_opt_type_mNe\", cast(\"b\".\"series_mNe\" as varchar) as \"series_mNe\", cast(\"b\".\"shop_code_mNe\" as varchar) as \"shop_code_mNe\", cast(\"b\".\"shop_name_mNe\" as varchar) as \"shop_name_mNe\", cast(\"b\".\"spec_code_mNe\" as varchar) as \"spec_code_mNe\", cast(\"b\".\"spec_id_mNe\" as varchar) as \"spec_id_mNe\", cast(\"b\".\"spec_name_mNe\" as varchar) as \"spec_name_mNe\", to_timestamp(\"b\".\"stat_date_mNe\") as \"stat_date_mNe\", cast(\"b\".\"stock_class_mNe\" as varchar) as \"stock_class_mNe\", cast(\"b\".\"suc_refund_amout_mNe\" as double) as \"suc_refund_amout_mNe\", cast(\"b\".\"suite_code_mNe\" as varchar) as \"suite_code_mNe\", cast(\"b\".\"suite_name_mNe\" as varchar) as \"suite_name_mNe\", cast(\"b\".\"suite_spec_code_mNe\" as varchar) as \"suite_spec_code_mNe\", cast(\"b\".\"suite_spec_name_mNe\" as varchar) as \"suite_spec_name_mNe\", cast(\"b\".\"unit_mNe\" as varchar) as \"unit_mNe\", cast(\"b\".\"virtual_cost_price_mNe\" as double) as \"virtual_cost_price_mNe\", cast(\"b\".\"weight_mNe\" as double) as \"weight_mNe\" from b), \n" +
      "d as (select \"data_source\", \"company\", \"sale_order_id\", \"sale_order_detail_id\", \"so_sale_order_id\", \"so_sale_order_detail_id\", \"order_type\", \"order_source\", \"order_status\", \"dept_code\", \"dept_name\", \"distributor_code\", \"distributor_name\", \"warehouse_code\", \"warehouse_name\", \"channel\", \"shop_code\", \"shop_name\", \"salesman_code\", \"salesman_name\", \"buyer_id\", \"buyer_name\", \"telephone\", \"express_company_code\", \"express_company_name\", \"express_number\", \"receive_province\", \"receive_city\", \"receive_district\", \"receive_address\", \"product_id\", \"spec_id\", \"suite_code\", \"suite_name\", \"suite_spec_code\", \"suite_spec_name\", \"product_code\", \"product_name\", \"spec_code\", \"spec_name\", cast(\"sale_num\" as double) as \"sale_num\", cast(\"sale_price\" as double) as \"sale_price\", cast(\"sale_amount\" as double) as \"sale_amount\", cast(\"sale_discount\" as double) as \"sale_discount\", cast(\"sale_post\" as double) as \"sale_post\", cast(\"sale_weight\" as double) as \"sale_weight\", \"is_gift\", \"product_status\", to_timestamp(\"order_time\") as \"order_time\", to_timestamp(\"pay_time\") as \"pay_time\", to_timestamp(\"order_sure_time\") as \"order_sure_time\", to_timestamp(\"send_time\") as \"send_time\", \"flag\", \"label\", \"remark\", \"supplier_code\", \"supplier_name\", \"document_status\", \"dt\", to_timestamp(\"collection_time\") as \"collection_time\", to_timestamp(\"delivery_time\") as \"delivery_time\", to_timestamp(\"sign_time\") as \"sign_time\", \"expert_id\", \"expert_name\", \"live_room_id\", \"traffic_genre\", \"is_presale\" from \"nc_dev\".\"dwd_trd_sys_sale_order_detail_f\"), \n" +
      "e as (select \"sale_order_id\" as \"sale_order_id_1c4\", \"buyer_id\" as \"buyer_id_1c4\", \"buyer_name\" as \"buyer_name_1c4\", \"channel\" as \"channel_1c4\", to_timestamp(\"collection_time\") as \"collection_time_1c4\", \"company\" as \"company_1c4\", \"data_source\" as \"data_source_1c4\", to_timestamp(\"delivery_time\") as \"delivery_time_1c4\", \"dept_code\" as \"dept_code_1c4\", \"dept_name\" as \"dept_name_1c4\", \"distributor_code\" as \"distributor_code_1c4\", \"distributor_name\" as \"distributor_name_1c4\", \"document_status\" as \"document_status_1c4\", \"dt\" as \"dt_1c4\", \"expert_id\" as \"expert_id_1c4\", \"expert_name\" as \"expert_name_1c4\", \"express_company_code\" as \"express_company_code_1c4\", \"express_company_name\" as \"express_company_name_1c4\", \"express_number\" as \"express_number_1c4\", \"flag\" as \"flag_1c4\", \"is_gift\" as \"is_gift_1c4\", \"is_presale\" as \"is_presale_1c4\", \"label\" as \"label_1c4\", \"live_room_id\" as \"live_room_id_1c4\", \"order_source\" as \"order_source_1c4\", \"order_status\" as \"order_status_1c4\", to_timestamp(\"order_sure_time\") as \"order_sure_time_1c4\", to_timestamp(\"order_time\") as \"order_time_1c4\", \"order_type\" as \"order_type_1c4\", to_timestamp(\"pay_time\") as \"pay_time_1c4\", \"product_code\" as \"product_code_1c4\", \"product_id\" as \"product_id_1c4\", \"product_name\" as \"product_name_1c4\", \"product_status\" as \"product_status_1c4\", \"receive_address\" as \"receive_address_1c4\", \"receive_city\" as \"receive_city_1c4\", \"receive_district\" as \"receive_district_1c4\", \"receive_province\" as \"receive_province_1c4\", \"remark\" as \"remark_1c4\", cast(\"sale_amount\" as double) as \"sale_amount_1c4\", cast(\"sale_discount\" as double) as \"sale_discount_1c4\", cast(\"sale_num\" as double) as \"sale_num_1c4\", \"sale_order_detail_id\" as \"sale_order_detail_id_1c4\", cast(\"sale_post\" as double) as \"sale_post_1c4\", cast(\"sale_price\" as double) as \"sale_price_1c4\", cast(\"sale_weight\" as double) as \"sale_weight_1c4\", \"salesman_code\" as \"salesman_code_1c4\", \"salesman_name\" as \"salesman_name_1c4\", to_timestamp(\"send_time\") as \"send_time_1c4\", \"shop_code\" as \"shop_code_1c4\", \"shop_name\" as \"shop_name_1c4\", to_timestamp(\"sign_time\") as \"sign_time_1c4\", \"so_sale_order_detail_id\" as \"so_sale_order_detail_id_1c4\", \"so_sale_order_id\" as \"so_sale_order_id_1c4\", \"spec_code\" as \"spec_code_1c4\", \"spec_id\" as \"spec_id_1c4\", \"spec_name\" as \"spec_name_1c4\", \"suite_code\" as \"suite_code_1c4\", \"suite_name\" as \"suite_name_1c4\", \"suite_spec_code\" as \"suite_spec_code_1c4\", \"suite_spec_name\" as \"suite_spec_name_1c4\", \"supplier_code\" as \"supplier_code_1c4\", \"supplier_name\" as \"supplier_name_1c4\", \"telephone\" as \"telephone_1c4\", \"traffic_genre\" as \"traffic_genre_1c4\", \"warehouse_code\" as \"warehouse_code_1c4\", \"warehouse_name\" as \"warehouse_name_1c4\" from d), \n" +
      "f as (select cast(\"e\".\"channel_1c4\" as varchar) as \"channel_1c4\", to_timestamp(\"e\".\"pay_time_1c4\") as \"pay_time_1c4\", cast(\"e\".\"product_id_1c4\" as varchar) as \"product_id_1c4\", cast(\"e\".\"sale_amount_1c4\" as double) as \"sale_amount_1c4\", cast(\"e\".\"sale_discount_1c4\" as double) as \"sale_discount_1c4\", cast(\"e\".\"sale_post_1c4\" as double) as \"sale_post_1c4\", cast(\"e\".\"shop_name_1c4\" as varchar) as \"shop_name_1c4\", cast(\"c\".\"category_mNe\" as varchar) as \"category_mNe\", cast(\"c\".\"channel_mNe\" as varchar) as \"channel_mNe\", cast(\"c\".\"product_id_mNe\" as varchar) as \"product_id_mNe\", cast(\"c\".\"shop_name_mNe\" as varchar) as \"shop_name_mNe\" from e LEFT JOIN c on ((COALESCE(cast(\"e\".\"product_code_1c4\" as varchar), '') || '--' || COALESCE(cast(\"e\".\"spec_code_1c4\" as varchar), '')) = (COALESCE(cast(\"c\".\"product_code_mNe\" as varchar), '') || '--' || COALESCE(cast(\"c\".\"spec_code_mNe\" as varchar), '')))), \n" +
      "g as (select to_date(cast(to_char(to_timestamp(\"pay_time_1c4\"), 'YYYY-MM-DD') as date)) as \"_time_dynamic_pay_time_1c4\", \"category_mNe\", \"product_id_1c4\", \"channel_1c4\", \"shop_name_1c4\", cast(sum(cast(\"sale_post_1c4\" as decimal)) as double) as \"xsyf_TOT\", cast(sum(cast(\"sale_discount_1c4\" as decimal)) as double) as \"xszkje_ZuL\", cast(sum(cast(\"sale_amount_1c4\" as decimal)) as double) as \"xsje_Sff\" from f group by \"_time_dynamic_pay_time_1c4\", \"category_mNe\", \"product_id_1c4\", \"channel_1c4\", \"shop_name_1c4\"), \n" +
      "h as (select to_date(\"_time_dynamic_pay_time_1c4\") as \"_time_dynamic_pay_time_1c4\", cast(\"category_mNe\" as varchar) as \"category_mNe\", cast(\"product_id_1c4\" as varchar) as \"product_id_1c4\", cast(\"channel_1c4\" as varchar) as \"channel_1c4\", cast(\"shop_name_1c4\" as varchar) as \"shop_name_1c4\", cast(\"xsyf_TOT\" as double) as \"xsyf_TOT\", cast(\"xszkje_ZuL\" as double) as \"xszkje_ZuL\", cast(\"xsje_Sff\" as double) as \"xsje_Sff\", cast((COALESCE(\"xsje_Sff\", 0) - COALESCE(\"xszkje_ZuL\", 0)+ COALESCE(\"xsyf_TOT\", 0) ) as double) as \"xssr_bUF\" from g), \n" +
      "i as (select to_date(\"_time_dynamic_pay_time_1c4\") as \"_time_dynamic_pay_time_1c4\", \"category_mNe\", \"product_id_1c4\", \"channel_1c4\", \"shop_name_1c4\", cast(\"xsyf_TOT\" as double) as \"xsyf_TOT\", cast(\"xszkje_ZuL\" as double) as \"xszkje_ZuL\", cast(\"xsje_Sff\" as double) as \"xsje_Sff\", cast(\"xssr_bUF\" as double) as \"xssr_bUF\", cast(null as double) as \"shje_13N\" from h), \n" +
      "j as (select \"data_source\", \"product_type\", \"product_id\", \"spec_id\", \"suite_code\", \"suite_name\", \"suite_spec_code\", \"suite_spec_name\", \"product_code\", \"product_name\", \"spec_code\", \"spec_name\", \"company\", \"channel\", \"shop_code\", \"shop_name\", \"brand\", \"category\", \"series\", \"unit\", cast(\"num\" as double) as \"num\", cast(\"weight\" as double) as \"weight\", \"pic\", cast(\"cost_price\" as double) as \"cost_price\", cast(\"virtual_cost_price\" as double) as \"virtual_cost_price\", to_timestamp(\"listing_time\") as \"listing_time\", \"product_lifecycle\", \"age_group\", \"stock_class\", \"is_best_sell\", \"is_potential\", \"is_profit\", \"is_inv_back\", \"is_high_aftersale\", \"self_opt_mode\", \"self_opt_type\" from \"nc_dev\".\"dim_product_spec\"), \n" +
      "k as (select \"product_name\" as \"product_name_mNe\", cast(null as double) as \"add_purchase_num_mNe\", cast(null as double) as \"add_purchase_people_mNe\", cast(null as double) as \"add_wish_list_people_mNe\", \"age_group\" as \"age_group_mNe\", \"brand\" as \"brand_mNe\", \"category\" as \"category_mNe\", \"channel\" as \"channel_mNe\", \"company\" as \"company_mNe\", cast(\"cost_price\" as double) as \"cost_price_mNe\", \"data_source\" as \"data_source_mNe\", \"is_best_sell\" as \"is_best_sell_mNe\", cast(null as VARCHAR) as \"is_channel_product_mNe\", \"is_high_aftersale\" as \"is_high_aftersale_mNe\", \"is_inv_back\" as \"is_inv_back_mNe\", \"is_potential\" as \"is_potential_mNe\", \"is_profit\" as \"is_profit_mNe\", to_timestamp(\"listing_time\") as \"listing_time_mNe\", cast(\"num\" as double) as \"num_mNe\", cast(null as double) as \"number_of_successfully_refunded_buyers_mNe\", cast(null as double) as \"number_of_successfully_refunded_orders_mNe\", cast(null as double) as \"pay_amout_mNe\", cast(null as double) as \"pay_buyers_mNe\", cast(null as double) as \"pay_items_mNe\", cast(null as double) as \"payment_order_num_mNe\", \"pic\" as \"pic_mNe\", cast(null as VARCHAR) as \"product_category_mNe\", \"product_code\" as \"product_code_mNe\", \"product_id\" as \"product_id_mNe\", \"product_lifecycle\" as \"product_lifecycle_mNe\", \"product_type\" as \"product_type_mNe\", cast(null as double) as \"product_views_mNe\", cast(null as double) as \"product_visitors_num_mNe\", cast(null as VARCHAR) as \"secondary_category_mNe\", \"self_opt_mode\" as \"self_opt_mode_mNe\", \"self_opt_type\" as \"self_opt_type_mNe\", \"series\" as \"series_mNe\", \"shop_code\" as \"shop_code_mNe\", \"shop_name\" as \"shop_name_mNe\", \"spec_code\" as \"spec_code_mNe\", \"spec_id\" as \"spec_id_mNe\", \"spec_name\" as \"spec_name_mNe\", cast(null as TIMESTAMP) as \"stat_date_mNe\", \"stock_class\" as \"stock_class_mNe\", cast(null as double) as \"suc_refund_amout_mNe\", \"suite_code\" as \"suite_code_mNe\", \"suite_name\" as \"suite_name_mNe\", \"suite_spec_code\" as \"suite_spec_code_mNe\", \"suite_spec_name\" as \"suite_spec_name_mNe\", \"unit\" as \"unit_mNe\", cast(\"virtual_cost_price\" as double) as \"virtual_cost_price_mNe\", cast(\"weight\" as double) as \"weight_mNe\" from j), \n" +
      "l as (select cast(\"k\".\"product_name_mNe\" as varchar) as \"product_name_mNe\", cast(\"k\".\"add_purchase_num_mNe\" as double) as \"add_purchase_num_mNe\", cast(\"k\".\"add_purchase_people_mNe\" as double) as \"add_purchase_people_mNe\", cast(\"k\".\"add_wish_list_people_mNe\" as double) as \"add_wish_list_people_mNe\", cast(\"k\".\"age_group_mNe\" as varchar) as \"age_group_mNe\", cast(\"k\".\"brand_mNe\" as varchar) as \"brand_mNe\", cast(\"k\".\"category_mNe\" as varchar) as \"category_mNe\", cast(\"k\".\"channel_mNe\" as varchar) as \"channel_mNe\", cast(\"k\".\"company_mNe\" as varchar) as \"company_mNe\", cast(\"k\".\"cost_price_mNe\" as double) as \"cost_price_mNe\", cast(\"k\".\"data_source_mNe\" as varchar) as \"data_source_mNe\", cast(\"k\".\"is_best_sell_mNe\" as varchar) as \"is_best_sell_mNe\", cast(\"k\".\"is_channel_product_mNe\" as varchar) as \"is_channel_product_mNe\", cast(\"k\".\"is_high_aftersale_mNe\" as varchar) as \"is_high_aftersale_mNe\", cast(\"k\".\"is_inv_back_mNe\" as varchar) as \"is_inv_back_mNe\", cast(\"k\".\"is_potential_mNe\" as varchar) as \"is_potential_mNe\", cast(\"k\".\"is_profit_mNe\" as varchar) as \"is_profit_mNe\", to_timestamp(\"k\".\"listing_time_mNe\") as \"listing_time_mNe\", cast(\"k\".\"num_mNe\" as double) as \"num_mNe\", cast(\"k\".\"number_of_successfully_refunded_buyers_mNe\" as double) as \"number_of_successfully_refunded_buyers_mNe\", cast(\"k\".\"number_of_successfully_refunded_orders_mNe\" as double) as \"number_of_successfully_refunded_orders_mNe\", cast(\"k\".\"pay_amout_mNe\" as double) as \"pay_amout_mNe\", cast(\"k\".\"pay_buyers_mNe\" as double) as \"pay_buyers_mNe\", cast(\"k\".\"pay_items_mNe\" as double) as \"pay_items_mNe\", cast(\"k\".\"payment_order_num_mNe\" as double) as \"payment_order_num_mNe\", cast(\"k\".\"pic_mNe\" as varchar) as \"pic_mNe\", cast(\"k\".\"product_category_mNe\" as varchar) as \"product_category_mNe\", cast(\"k\".\"product_code_mNe\" as varchar) as \"product_code_mNe\", cast(\"k\".\"product_id_mNe\" as varchar) as \"product_id_mNe\", cast(\"k\".\"product_lifecycle_mNe\" as varchar) as \"product_lifecycle_mNe\", cast(\"k\".\"product_type_mNe\" as varchar) as \"product_type_mNe\", cast(\"k\".\"product_views_mNe\" as double) as \"product_views_mNe\", cast(\"k\".\"product_visitors_num_mNe\" as double) as \"product_visitors_num_mNe\", cast(\"k\".\"secondary_category_mNe\" as varchar) as \"secondary_category_mNe\", cast(\"k\".\"self_opt_mode_mNe\" as varchar) as \"self_opt_mode_mNe\", cast(\"k\".\"self_opt_type_mNe\" as varchar) as \"self_opt_type_mNe\", cast(\"k\".\"series_mNe\" as varchar) as \"series_mNe\", cast(\"k\".\"shop_code_mNe\" as varchar) as \"shop_code_mNe\", cast(\"k\".\"shop_name_mNe\" as varchar) as \"shop_name_mNe\", cast(\"k\".\"spec_code_mNe\" as varchar) as \"spec_code_mNe\", cast(\"k\".\"spec_id_mNe\" as varchar) as \"spec_id_mNe\", cast(\"k\".\"spec_name_mNe\" as varchar) as \"spec_name_mNe\", to_timestamp(\"k\".\"stat_date_mNe\") as \"stat_date_mNe\", cast(\"k\".\"stock_class_mNe\" as varchar) as \"stock_class_mNe\", cast(\"k\".\"suc_refund_amout_mNe\" as double) as \"suc_refund_amout_mNe\", cast(\"k\".\"suite_code_mNe\" as varchar) as \"suite_code_mNe\", cast(\"k\".\"suite_name_mNe\" as varchar) as \"suite_name_mNe\", cast(\"k\".\"suite_spec_code_mNe\" as varchar) as \"suite_spec_code_mNe\", cast(\"k\".\"suite_spec_name_mNe\" as varchar) as \"suite_spec_name_mNe\", cast(\"k\".\"unit_mNe\" as varchar) as \"unit_mNe\", cast(\"k\".\"virtual_cost_price_mNe\" as double) as \"virtual_cost_price_mNe\", cast(\"k\".\"weight_mNe\" as double) as \"weight_mNe\" from k), \n" +
      "m as (select \"data_source\", \"company\", \"aftersale_order_id\", \"aftersale_order_detail_id\", \"aftersale_order_status\", \"aftersale_type\", \"sale_order_id\", \"sale_order_detail_id\", \"so_sale_order_id\", \"so_sale_order_detail_id\", \"dept_code\", \"dept_name\", \"warehouse_code\", \"warehouse_name\", \"channel\", \"shop_code\", \"shop_name\", \"express_company_code\", \"express_company_name\", \"express_number\", \"suite_code\", \"suite_name\", \"product_code\", \"product_name\", \"spec_code\", \"spec_name\", cast(\"aftersale_num\" as double) as \"aftersale_num\", cast(\"aftersale_price\" as double) as \"aftersale_price\", cast(\"aftersale_amount\" as double) as \"aftersale_amount\", \"product_status\", \"reason_type\", to_timestamp(\"return_time\") as \"return_time\", to_timestamp(\"refund_time\") as \"refund_time\", \"remark\", \"so_aftersale_order_id\", \"so_aftersale_order_detail_id\", cast(\"apply_aftersale_num\" as double) as \"apply_aftersale_num\", \"product_aftersale_type\", \"aftersale_status\", \"dt\", \"product_id\", \"spec_id\" from \"nc_dev\".\"dwd_trd_sys_aftersale_order_detail_f\"), \n" +
     

fe.conf enable_parser_context_cache=false; 可以规避。 你能稳定复现吗,我们一直在追查这个问题

可以稳定复现的 有些比较长的sql

加个微信吗 大佬

这个可不可以优化一下 做个lru缓存 关闭的话 对于一些大sql的解析 会增加耗时
或者解析完一个sql 清一次缓存

这个很可能是第三方库的BUG

是的 antlr的问题 但是有解决方法 看antlr4的issure有些人解决了
这个是其中一个