SQL报错:
2025-11-13 09:28:40 Error -1 (00000) : Error while executing SQL "/**/ with FH as( SELECT 'Y' AS edw_valid_flag, 'Y' AS edw_data_source, now () AS edw_create_date, now () AS edw_last_update, t2.contract_number, t2.product_type, t2.segment1, t2.description, t2.quantity_issued, t2.salesrep_name, t2.salesdep_name, t2.s40_date, t2.entity_name, t2.prod_line_name, t2.prod_team_name, t2.prod_group_name, t2.prod_class_check_name, t2.project_number, t2.project_name, t2.name, t2.overall_unit_name, t2.device_type, t2.unit_num, t2.dates, t2.yys, t2.overall_unit_name as l5_name, t4.l5_unit, t2.device_type as l4_name, t4.l4_unit, t4.l3_name, t4.l3_unit, t4.l2_name, t4.l2_unit, t4.l1_name, t4.l1_unit FROM ( SELECT contract_number, product_type, segment1, description, quantity_issued, salesrep_name, salesdep_name, s40_date, entity_name, prod_line_name, prod_team_name, prod_group_name, prod_class_check_name, project_number, project_name, name, overall_unit_name, device_type, unit_num, dates, yys FROM dm_plan_shipping_statistics_test2 where s40_date >= CAST( CONCAT (CAST(YEAR (CURRENT_DATE) - 5 AS STRING), '-01-01') AS DATE ) and s40_date <= CURRENT_DATE union all select contract_number_cor as contract_number, master_code as product_type, contract_gbom as segment1, gname as description, scan_qty as quantity_issued, salesrep_name, salesdep_name, issue_date as s40_date, entity_name, prod_line_name, prod_team_name, prod_group_name, prod_class_check_name, project_number, project_name, name, overall_unit_name, device_type, unit_num, dates, CASE WHEN SUBSTR (t3.salesdep_name, 1, 2) = '政企' THEN '政企' WHEN SUBSTR (t3.salesdep_name, 1, 2) = '电源' THEN '其他' WHEN SUBSTR (t3.name, 1, 2) = '中兴' THEN '其他' WHEN SUBSTR (t3.name, 1, 4) = '中国电信' THEN '中国电信' WHEN SUBSTR (t3.name, 1, 4) = '中国联合' THEN '中国联通' WHEN SUBSTR (t3.name, 1, 4) = '中国移动' THEN '中国移动' WHEN SUBSTR (t3.salesdep_name, 1, 2) NOT IN ('第三', '政企') THEN '国际' ELSE '其他' END AS yys from ( select b2b.contract_number_cor, b2b.master_code, b2b.contract_gbom, b2b.gname, b2b.scan_qty, b2b.salesrep_name, b2b.salesdep_name, b2b.issue_date, t1.entity_name, pcn.prod_line_name, pcn.prod_team_name, pcn.prod_group_name, pcn.prod_class_check_name, chc.project_number, cepi.project_name, soe.name, ouh.overall_unit_name, ouh.device_type, oud.unit_num, DATE_FORMAT (CAST(b2b.issue_date AS DATE), '%Y-%m') AS dates from dm_prod_domain_delivery_b2b_qd b2b LEFT join ods_mes_cpm_contract_entities t1 on t1.contract_line_id = b2b.contract_line_id left join ods_srm_op_prodclass_dp pcn on pcn.prod_class_name = b2b.master_code left join ods_mes_cdm_contract_lines ccl on b2b.contract_line_id = ccl.contract_line_id left join ods_mes_cdm_contract_headers cch on ccl.contract_header_id = cch.contract_header_id right join ods_cms_cdm_contract_baseinfo ccb on cch.contract_baseinfo_id = ccb.contract_baseinfo_id RIGHT JOIN ods_cms_cdm_hc_contracts chc ON ccb.hc_contract_id = chc.hc_contract_id LEFT JOIN ods_cms_cdm_ecc_project_info cepi ON cepi.project_number = chc.project_number LEFT JOIN ods_msm_pm_proj proj ON proj.proj_num = chc.project_number LEFT JOIN ods_scrm_pm_proj_customer pc ON pc.proj_id = proj.proj_id LEFT JOIN ods_scrm_s_org_ext soe ON soe.ou_num = pc.acnt_id LEFT JOIN ods_scrm_s_org_ext_x t2 ON soe.row_id = t2.row_id LEFT join ods_scp_ba_overall_unit_detail oud on oud.item_no = b2b.contract_gbom LEFT join ods_scp_ba_overall_unit_head ouh on ouh.head_id = oud.head_id where b2b.contract_line_id = ccl.contract_line_id and b2b.meaning = '发货完成' and ouh.enabled = 1 and oud.enabled = 1 and COALESCE(b2b.scan_qty, 0) != 0 and b2b.issue_date >= CAST( CONCAT (CAST(YEAR (CURRENT_DATE) - 5 AS STRING), '-01-01') AS DATE ) and b2b.issue_date <= CURRENT_DATE ) as t3 ) t2 left join ( SELECT oud.item_no, ouh.overall_unit_name AS tag_name, spt.tag_type, spt.tag_item_type, ouh.overall_unit_name AS l5_name, pm5.l5_unit, ouh.device_type AS l4_name, pm5.l4_unit, opm.product_model_class AS l3_name, pm5.l3_unit, pm5.l2_name, pm5.l2_unit, pm5.l1_name, pm5.l1_unit, ouh.prod_class, pcn.prod_class_check_name, pm5.prod_team_name, pm5.prod_line_name FROM ods_scp_ba_overall_unit_detail oud LEFT JOIN ods_scp_ba_overall_unit_head ouh ON ouh.head_id = oud.head_id AND ouh.enabled = 1 LEFT JOIN ods_scp_sop_product_tag spt ON spt.tag_id = ouh.product_tag_id AND spt.valid_flag = 'Y' LEFT JOIN ods_scp_aps_product_model opm ON opm.product_model_no = ouh.device_code AND opm.data_losed = 0 LEFT JOIN ( SELECT DISTINCT pd.pdm_prod_class_name, pd.prod_class_check_name FROM ods_srm_op_prodclass_dp pd WHERE pd.enabled_flag = 1 ) pcn ON pcn.pdm_prod_class_name = ouh.prod_class LEFT JOIN dm_product_model_5level pm5 ON pm5.prod_class_check_name = pcn.prod_class_check_name AND pm5.l3_name = opm.product_model_class WHERE ouh.enabled = 1 ) t4 ON t4.item_no = t2.segment1 and t4.prod_class_check_name = t2.prod_class_check_name ) select t5.edw_valid_flag, t5.edw_data_source, t5.edw_create_date, t5.edw_last_update, t5.contract_number, t5.product_type, t5.segment1, t5.description, t5.quantity_issued, t5.salesrep_name, t5.salesdep_name, t5.s40_date, t5.entity_name, t5.prod_line_name, t5.prod_team_name, t5.prod_group_name, t5.prod_class_check_name, t5.project_number, t5.project_name, t5.name, t5.overall_unit_name, t5.device_type, t5.unit_num, t5.dates, t5.yys, t5.l5_name, t5.l5_unit, t5.l4_name, t5.l4_unit, t5.l3_name, t5.l3_unit, t5.l2_name, t5.l2_unit, t5.l1_name, t5.l1_unit from FH t5": Remote driver error: OlapException: Query failed (#20251113_012840_07516_iezz7): line 3:6: Schema must be specified when session schema is not set -> SQLException: Query failed (#20251113_012840_07516_iezz7): line 3:6: Schema must be specified when session schema is not set -> FailureException: line 3:6: Schema must be specified when session schema is not set