为了更快的定位您的问题,请提供以下信息,谢谢
【详述】问题详细描述
这个sql里面有row_number开窗去重, 把这个row_number去掉就能出来, 有这个row_number就出不来.
row_number或者说窗口函数不能spill吗? 不能流式吗? 怎么会消耗这么多内存啊
3.3.2版本修改了一个row_number内存泄漏的问题, 但是还是跑不出来
SELECT `数据来源`, `公司`, `销售主订单号`, `销售子订单号`, `来源销售主订单号`, `来源销售子订单号`, `订单类型`, `订单来源`, `订单状态`, `部门编码`, `部门名称`, `分销商编码`, `分销商名称`, `仓库编码`, `仓库名称`, `渠道`, `店铺编码`, `店铺名称`, `业务员编码`, `业务员名称`, `买家ID`, `买家名称`, `联系电话`, `快递公司编码`, `快递公司名称`, `快递单号`, `收货省份`, `收货市`, `收货区`, `收货地址`, `商品ID`, `规格ID`, `组合商品编码`, `组合商品名称`, `组合规格编码`, `组合规格名称`, `商品编码`, `商品名称`, `规格编码`, `规格名称`, `销售数量`, `销售单价`, `销售金额`, `销售折扣金额`, `销售运费`, `销售重量`, `是否赠品`, `下单时间`, `支付时间`, `订单确认时间`, `发货时间`, `标签`, `旗帜`, `备注`, `平台货品名称`, `经营报表店铺`, `KPI渠道`, `分摊后总价`, `退款状态`
FROM (SELECT `data_source` AS `数据来源`, `company` AS `公司`, `sale_order_id` AS `销售主订单号`, `sale_order_detail_id` AS `销售子订单号`, `so_sale_order_id` AS `来源销售主订单号`, `so_sale_order_detail_id` AS `来源销售子订单号`, `order_type` AS `订单类型`, `order_source` AS `订单来源`, `order_status` AS `订单状态`, `dept_code` AS `部门编码`, `dept_name` AS `部门名称`, NULL AS `分销商编码`, `distributor_name` AS `分销商名称`, `warehouse_code` AS `仓库编码`, `warehouse_name` AS `仓库名称`, `channel` AS `渠道`, `shop_code` AS `店铺编码`, `shop_name` AS `店铺名称`, `salesman_code` AS `业务员编码`, `salesman_name` AS `业务员名称`, `buyer_id` AS `买家ID`, `buyer_name` AS `买家名称`, `telephone` AS `联系电话`, `express_company_code` AS `快递公司编码`, `express_company_name` AS `快递公司名称`, `express_number` AS `快递单号`, `receive_province` AS `收货省份`, `receive_city` AS `收货市`, `receive_district` AS `收货区`, `receive_address` AS `收货地址`, `product_id` AS `商品ID`, `spec_id` AS `规格ID`, `suite_code` AS `组合商品编码`, `suite_name` AS `组合商品名称`, `suite_spec_code` AS `组合规格编码`, `suite_spec_name` AS `组合规格名称`, `product_code` AS `商品编码`, `product_name` AS `商品名称`, `spec_code` AS `规格编码`, `spec_name` AS `规格名称`, `sale_num` AS `销售数量`, `sale_price` AS `销售单价`, `sale_amount` AS `销售金额`, `sale_discount` AS `销售折扣金额`, `sale_post` AS `销售运费`, `sale_weight` AS `销售重量`, `is_gift` AS `是否赠品`, `order_time` AS `下单时间`, `pay_time` AS `支付时间`, `order_sure_time` AS `订单确认时间`, `send_time` AS `发货时间`, `label` AS `标签`, `seller_flag` AS `旗帜`, `remark` AS `备注`, `palt_product_name` AS `平台货品名称`, CASE WHEN `shop_name` = '自由点旗舰店(抖音)' THEN CAST(CASE WHEN `palt_product_name` LIKE '%-H' THEN '旗舰店一店' WHEN `palt_product_name` LIKE '%-Z' THEN '旗舰店二店/快手' WHEN (((`distributor_name` = '%1849834221608643%' OR `distributor_name` = '%2946311420121309%') OR `distributor_name` = '%101873038474%') OR `distributor_name` = '%2714049312730847%') THEN '达播' ELSE '商城' END AS VARCHAR) WHEN `shop_name` = '自由点官方旗舰店抖音小店' THEN CAST(CASE WHEN `palt_product_name` LIKE '%-T' THEN '大健康直播间一店' WHEN `palt_product_name` LIKE '%-R' THEN '大健康直播间二店' WHEN ((((((`distributor_name` = '%1849834221608643%' OR `distributor_name` = '%2714049312730847%') OR `distributor_name` = '%96489786768%') OR `distributor_name` = '%2067551411513246%') OR `distributor_name` = '%101873038474%') OR `distributor_name` = '%3259388284634944%') OR `distributor_name` = '%3403731313113848%') THEN '达播' ELSE '商城' END AS VARCHAR) WHEN `shop_name` = '自由点家居清洁旗舰店(抖音)' THEN '达播' WHEN `shop_name` = '快手自由点个护旗舰店' THEN CAST(CASE WHEN `channel` = '分销' THEN '达播' ELSE '商城' END AS VARCHAR) WHEN `shop_name` = '自由点微信视频号' THEN CAST(CASE WHEN `distributor_name` IS NOT NULL THEN '达播' ELSE '商城' END AS VARCHAR) WHEN `shop_name` = '小红书自由点Freemore旗舰店' THEN '达播' ELSE CAST(NULL AS VARCHAR) END AS `经营报表店铺`, CASE WHEN `shop_name` = '自由点旗舰店(抖音)' THEN CAST(CASE WHEN `palt_product_name` LIKE '%-H' THEN '旗舰店一店' WHEN `palt_product_name` LIKE '%-Z' THEN '旗舰店二店/快手' WHEN (((`distributor_name` = '%1849834221608643%' OR `distributor_name` = '%2946311420121309%') OR `distributor_name` = '%101873038474%') OR `distributor_name` = '%2714049312730847%') THEN '达播' ELSE '商城及其他' END AS VARCHAR) WHEN `shop_name` = '自由点官方旗舰店抖音小店' THEN CAST(CASE WHEN `palt_product_name` LIKE '%-T' THEN '大健康/效果广告' WHEN `palt_product_name` LIKE '%-R' THEN '大健康/效果广告' WHEN ((((((`distributor_name` = '%1849834221608643%' OR `distributor_name` = '%2714049312730847%') OR `distributor_name` = '%96489786768%') OR `distributor_name` = '%2067551411513246%') OR `distributor_name` = '%101873038474%') OR `distributor_name` = '%3259388284634944%') OR `distributor_name` = '%3403731313113848%') THEN '达播' ELSE '商城及其他' END AS VARCHAR) WHEN `shop_name` = '自由点家居清洁旗舰店(抖音)' THEN '达播' WHEN `shop_name` = '快手自由点个护旗舰店' THEN CAST(CASE WHEN `channel` = '分销' THEN '达播' ELSE '商城及其他' END AS VARCHAR) WHEN `shop_name` = '自由点微信视频号' THEN CAST(CASE WHEN `distributor_name` IS NOT NULL THEN '达播' ELSE '商城及其他' END AS VARCHAR) WHEN `shop_name` = '小红书自由点Freemore旗舰店' THEN '达播' ELSE CAST(NULL AS VARCHAR) END AS `KPI渠道`, `share_amount` AS `分摊后总价`, `refund_status` AS `退款状态`
FROM (SELECT '旺店通旗舰奇门' AS `data_source`, '公司' AS `company`, `sale_order_id`, `sale_order_detail_id`, `so_sale_order_id`, `so_sale_order_detail_id`, `order_type`, `order_source`, `order_status`, NULL AS `dept_code`, NULL AS `dept_name`, `warehouse_code`, `warehouse_name`, `channel`, `shop_code`, `shop_name`, NULL AS `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_code` AS `suite_spec_code`, `suite_name` AS `suite_spec_name`, `product_code`, `product_name`, `spec_code`, `spec_name`, `sale_num`, `sale_price`, `sale_amount`, `sale_discount`, CASE WHEN CASE WHEN (COUNT(`sale_amount`) OVER (PARTITION BY `sale_order_id`)) > 0 THEN (SUM(`sale_amount`) OVER (PARTITION BY `sale_order_id`)) ELSE CAST(NULL AS DOUBLE) END = 0 THEN 0 ELSE (`sale_post` * (CAST(`sale_amount` AS DECIMAL(38, 8)) / CAST(CASE WHEN (COUNT(`sale_amount`) OVER (PARTITION BY `sale_order_id`)) > 0 THEN (SUM(`sale_amount`) OVER (PARTITION BY `sale_order_id`)) ELSE CAST(NULL AS DOUBLE) END AS DECIMAL(38, 8)))) END AS `sale_post`, `sale_weight`, `is_gift`, `order_time`, `pay_time`, `order_sure_time`, `remark`, `send_time`, `seller_flag`, `label`, `distributor_name`, `palt_product_name`, `share_amount`, `refund_status`
FROM (SELECT `t`.`trade_no` AS `sale_order_id`, `t`.`sale_order_detail_id`, `t`.`so_sale_order_id`, `t`.`so_sale_order_detail_id`, `t`.`order_type`, `t`.`order_source`, `t`.`order_status`, `t`.`warehouse_no` AS `warehouse_code`, `ods_api_wdtqjqm_warehouse_info_f`.`name` AS `warehouse_name`, `t`.`channel`, `t`.`shop_no` AS `shop_code`, `t`.`shop_name`, `t`.`salesman_name`, `t`.`customer_no` AS `buyer_id`, NULL AS `buyer_name`, NULL AS `telephone`, `t`.`logistics_code` AS `express_company_code`, `t`.`logistics_name` AS `express_company_name`, `t`.`logistics_no` AS `express_number`, `t`.`receive_province`, `t`.`receive_city`, `t`.`receive_district`, `t`.`receiver_area` AS `receive_address`, `t`.`product_id`, `t`.`spec_id`, `t`.`suite_code`, `t`.`suite_name`, `t`.`product_code`, `t`.`product_name`, `t`.`palt_product_name`, `t`.`spec_code`, `t`.`spec_name`, `t`.`sale_num`, `t`.`sale_price`, `t`.`sale_amount`, `t`.`sale_discount`, `t`.`sale_post`, 0 AS `sale_weight`, `t`.`is_gift`, `t`.`order_time`, `t`.`pay_time`, `t`.`pay_time` AS `order_sure_time`, `t`.`send_time`, `t`.`trade_label` AS `label`, `t`.`seller_flag`, `t`.`remark`, `t`.`fenxiao_nick` AS `distributor_name`, `t`.`share_amount`, `t`.`refund_status`
FROM (SELECT `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`customer_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`fenxiao_nick`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_code`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`pay_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`receiver_area`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`salesman_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`shop_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_label`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`warehouse_no`, `ods_api_wdtqjqm_shop_info_f`.`shop_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_order_detail_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`so_sale_order_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`so_sale_order_detail_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_type`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_source`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_status`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`channel`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`receive_province`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`receive_city`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`receive_district`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`product_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`spec_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`suite_code`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`suite_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`product_code`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`product_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`palt_product_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`spec_code`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`spec_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_num`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_price`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_amount`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_discount`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sale_post`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`is_gift`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`send_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`seller_flag`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`remark`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`share_amount`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`refund_status`
FROM (SELECT `customer_no` AS `customer_no`, `fenxiao_nick` AS `fenxiao_nick`, `logistics_code` AS `logistics_code`, `logistics_name` AS `logistics_name`, `logistics_no` AS `logistics_no`, `pay_time` AS `pay_time`, `receiver_area` AS `receiver_area`, `salesman_name` AS `salesman_name`, `shop_no` AS `shop_no`, `trade_label` AS `trade_label`, `trade_no` AS `trade_no`, `warehouse_no` AS `warehouse_no`, `sale_order_detail_id`, `so_sale_order_id`, `so_sale_order_detail_id`, `order_type`, `order_source`, `order_status`, `channel`, `receive_province`, `receive_city`, `receive_district`, `product_id`, `spec_id`, `suite_code`, `suite_name`, `product_code`, `product_name`, `palt_product_name`, `spec_code`, `spec_name`, `sale_num`, `sale_price`, `sale_amount`, `sale_discount`, `sale_post`, `is_gift`, `order_time`, `send_time`, `seller_flag`, `remark`, `share_amount`, `refund_status`
FROM (SELECT `customer_no`, `fenxiao_nick`, `logistics_code`, `logistics_name`, `logistics_no`, `pay_time`, `receiver_area`, `salesman_name`, `shop_no`, `trade_label`, `trade_no`, `warehouse_no`, CAST(CAST(`order_detail` AS JSON) -> 'rec_id' AS VARCHAR) AS `sale_order_detail_id`, CAST(CAST(`order_detail` AS JSON) -> 'src_tid' AS VARCHAR) AS `so_sale_order_id`, CAST(CAST(`order_detail` AS JSON) -> 'src_oid' AS VARCHAR) AS `so_sale_order_detail_id`, CONCAT('内部销售订单-', CASE WHEN `trade_type` = '1' THEN '网店销售' WHEN `trade_type` = '2' THEN '线下订单' WHEN `trade_type` = '3' THEN '售后换货' WHEN `trade_type` = '4' THEN '批发业务' WHEN `trade_type` = '7' THEN '现款销售' WHEN `trade_type` = '8' THEN '分销订单' WHEN `trade_type` = '101' THEN '自定义类型' WHEN `trade_type` = '102' THEN '自定义类型' WHEN `trade_type` = '103' THEN '自定义类型' WHEN `trade_type` = '104' THEN '自定义类型' WHEN `trade_type` = '105' THEN '自定义类型' WHEN `trade_type` = '106' THEN '自定义类型' ELSE CAST(NULL AS VARCHAR) END) AS `order_type`, CASE WHEN `trade_from` = '1' THEN 'api抓单' WHEN `trade_from` = '2' THEN '手工建单' WHEN `trade_from` = '3' THEN '导入' WHEN `trade_from` = '4' THEN '复制订单' WHEN `trade_from` = '5' THEN '接口推送' WHEN `trade_from` = '6' THEN '补发订单' WHEN `trade_from` = '7' THEN 'PDA选货开单' WHEN `trade_from` = '8' THEN '分销补发订单' ELSE `trade_from` END AS `order_source`, CASE WHEN `trade_status` = '4' THEN '线下退款' WHEN `trade_status` = '5' THEN '已取消' WHEN `trade_status` = '6' THEN '待转预订单' WHEN `trade_status` = '7' THEN '待转已完成' WHEN `trade_status` = '10' THEN '未付款' WHEN `trade_status` = '12' THEN '待尾款' WHEN `trade_status` = '15' THEN '等未付' WHEN `trade_status` = '16' THEN '延时审核' WHEN `trade_status` = '19' THEN '预订单前处理' WHEN `trade_status` = '20' THEN '审核前处理' WHEN `trade_status` = '21' THEN '自流转待发货' WHEN `trade_status` = '23' THEN '异常订单' WHEN `trade_status` = '24' THEN '换货预订单' WHEN `trade_status` = '25' THEN '待处理预订单' WHEN `trade_status` = '27' THEN '待分配预订单' WHEN `trade_status` = '30' THEN '待客审' WHEN `trade_status` = '35' THEN '待财审' WHEN `trade_status` = '55' THEN '已审核' WHEN `trade_status` = '95' THEN '已发货' WHEN `trade_status` = '96' THEN '成本确认' WHEN `trade_status` = '101' THEN '已过账' WHEN `trade_status` = '110' THEN '已完成' ELSE `trade_status` END AS `order_status`, CASE WHEN `platform_id` = '127' THEN '其他(自有商城)' WHEN `platform_id` = '0' THEN '线下' WHEN (`platform_id` = '1' AND `sub_platform_id` = '0') THEN '淘宝-淘宝集市' WHEN (`platform_id` = '1' AND `sub_platform_id` = '1') THEN '淘宝-天猫商城' WHEN `platform_id` = '2' THEN '淘宝分销' WHEN (`platform_id` = '3' AND `sub_platform_id` = '0') THEN '京东-SOP' WHEN (`platform_id` = '3' AND `sub_platform_id` = '1') THEN '京东-LBP' WHEN (`platform_id` = '3' AND `sub_platform_id` = '2') THEN '京东-SOPL' WHEN (`platform_id` = '3' AND `sub_platform_id` = '3') THEN '京东-FBP/FCS' WHEN (`platform_id` = '3' AND `sub_platform_id` = '4') THEN '京东-全球购' WHEN (`platform_id` = '3' AND `sub_platform_id` = '5') THEN '京东-厂家直送' WHEN (`platform_id` = '3' AND `sub_platform_id` = '6') THEN '京东-京东供销' WHEN (`platform_id` = '3' AND `sub_platform_id` = '7') THEN '京东-EDI' WHEN `platform_id` = '4' THEN '拍拍' WHEN `platform_id` = '5' THEN '亚马逊' WHEN `platform_id` = '6' THEN '1号店' WHEN `platform_id` = '7' THEN '当当网' WHEN (`platform_id` = '8' AND `sub_platform_id` = '0') THEN '国美' WHEN (`platform_id` = '8' AND `sub_platform_id` = '1') THEN '国美-国营自营' WHEN (`platform_id` = '9' AND `sub_platform_id` = '0') THEN '阿里巴巴' WHEN (`platform_id` = '9' AND `sub_platform_id` = '2') THEN '阿里巴巴-C2M(淘工厂)' WHEN `platform_id` = '10' THEN 'ECShop' WHEN `platform_id` = '11' THEN '麦考林' WHEN `platform_id` = '12' THEN 'V+' WHEN (`platform_id` = '13' AND `sub_platform_id` = '0') THEN '苏宁' WHEN (`platform_id` = '13' AND `sub_platform_id` = '1') THEN '苏宁-苏宁特卖' WHEN (`platform_id` = '14' AND `sub_platform_id` = '0') THEN '唯品会' WHEN (`platform_id` = '14' AND `sub_platform_id` = '1') THEN '唯品会-marketplace' WHEN `platform_id` = '15' THEN '易迅' WHEN (`platform_id` = '16' AND `sub_platform_id` = '0') THEN '聚美' WHEN (`platform_id` = '16' AND `sub_platform_id` = '1') THEN '聚美-聚美国际' WHEN `platform_id` = '17' THEN '有赞(口袋通)' WHEN `platform_id` = '18' THEN 'Hishop' WHEN `platform_id` = '19' THEN '微铺宝' WHEN `platform_id` = '20' THEN '美丽说' WHEN (`platform_id` = '21' AND `sub_platform_id` = '0') THEN '蘑菇街' WHEN (`platform_id` = '21' AND `sub_platform_id` = '1') THEN '蘑菇街-锐鲨科技' WHEN `platform_id` = '22' THEN '贝贝网' WHEN `platform_id` = '23' THEN 'ECstore' WHEN `platform_id` = '24' THEN '折800' WHEN `platform_id` = '25' THEN '融e购' WHEN `platform_id` = '26' THEN '穿衣助手' WHEN `platform_id` = '27' THEN '楚楚街' WHEN (`platform_id` = '28' AND `sub_platform_id` = '0') THEN '微盟-旺铺' WHEN (`platform_id` = '28' AND `sub_platform_id` = '1') THEN '微盟-微商城' WHEN (`platform_id` = '28' AND `sub_platform_id` = '2') THEN '微盟-智慧零售' WHEN `platform_id` = '29' THEN '卷皮网' WHEN `platform_id` = '30' THEN '顺丰嘿客' WHEN `platform_id` = '32' THEN '微店' WHEN `platform_id` = '33' THEN '百度mall' WHEN `platform_id` = '34' THEN '蜜芽宝贝' WHEN `platform_id` = '35' THEN '明星衣橱' WHEN `platform_id` = '36' THEN '善融商城' WHEN `platform_id` = '37' THEN '速卖通' WHEN `platform_id` = '38' THEN '萌店' WHEN (`platform_id` = '39' AND `sub_platform_id` = '0') THEN '拼多多' WHEN (`platform_id` = '39' AND `sub_platform_id` = '1') THEN '拼多多-国际店铺' WHEN (`platform_id` = '39' AND `sub_platform_id` = '2') THEN '拼多多-快团团' WHEN `platform_id` = '40' THEN '京东到家' WHEN `platform_id` = '41' THEN '百度外卖' WHEN `platform_id` = '42' THEN '美团外卖' WHEN `platform_id` = '45' THEN '饿了么' WHEN `platform_id` = '46' THEN '我买网' WHEN `platform_id` = '47' THEN '人人店' WHEN `platform_id` = '48' THEN '美囤妈妈(宝宝树)' WHEN `platform_id` = '49' THEN '91拼团' WHEN `platform_id` = '50' THEN '考拉海购' WHEN `platform_id` = '51' THEN '千米网' WHEN `platform_id` = '52' THEN '特奢汇' WHEN `platform_id` = '53' THEN '楚楚街拼团' WHEN (`platform_id` = '55' AND `sub_platform_id` = '0') THEN '孩子王' WHEN (`platform_id` = '55' AND `sub_platform_id` = '1') THEN '孩子王-一件代发' WHEN `platform_id` = '56' THEN '小红书' WHEN (`platform_id` = '57' AND `sub_platform_id` = '0') THEN '格格家' WHEN (`platform_id` = '57' AND `sub_platform_id` = '1') THEN '格格家-环球捕手' WHEN (`platform_id` = '58' AND `sub_platform_id` = '0') THEN '云集' WHEN (`platform_id` = '58' AND `sub_platform_id` = '1') THEN '云集-云集POP' WHEN `platform_id` = '59' THEN '楚楚通' WHEN `platform_id` = '60' THEN '返利网' WHEN `platform_id` = '61' THEN '酒仙网' WHEN `platform_id` = '62' THEN '平安好医生' WHEN `platform_id` = '63' THEN '下厨房' WHEN `platform_id` = '64' THEN '好食期' WHEN `platform_id` = '65' THEN '大V店' WHEN `platform_id` = '66' THEN '好衣库(鲸灵)' WHEN `platform_id` = '67' THEN '达令家' WHEN `platform_id` = '68' THEN '爱库存' WHEN (`platform_id` = '69' AND `sub_platform_id` = '0') THEN '抖店(放心购)' WHEN (`platform_id` = '69' AND `sub_platform_id` = '1') THEN '抖店(放心购)-厂家代打' WHEN `platform_id` = '70' THEN '每日一淘' WHEN `platform_id` = '71' THEN '贝壳优品' WHEN `platform_id` = '72' THEN '小米有品' WHEN `platform_id` = '73' THEN '未来集市' WHEN `platform_id` = '74' THEN '爱奇艺商城' WHEN `platform_id` = '75' THEN '快手小店' WHEN `platform_id` = '76' THEN '魔筷星选' WHEN `platform_id` = '77' THEN '海拍客' WHEN `platform_id` = '78' THEN '壹钱包' WHEN `platform_id` = '79' THEN '每日优鲜' WHEN (`platform_id` = '80' AND `sub_platform_id` = '0') THEN '网易严选' WHEN (`platform_id` = '80' AND `sub_platform_id` = '1') THEN '网易严选-代销2.0' WHEN `platform_id` = '81' THEN '多点' WHEN `platform_id` = '82' THEN '天猫超市盘货' WHEN `platform_id` = '83' THEN '微信视频号' WHEN `platform_id` = '84' THEN '娇兰佳人' WHEN `platform_id` = '85' THEN '途虎养车' WHEN `platform_id` = '86' THEN '今日爆团' WHEN `platform_id` = '87' THEN '阿里健康大药房' WHEN `platform_id` = '88' THEN '必要' WHEN `platform_id` = '89' THEN '腾讯枫页' WHEN `platform_id` = '90' THEN '微信小商店' WHEN `platform_id` = '91' THEN '快手金牛' WHEN `platform_id` = '92' THEN '摩点' WHEN `platform_id` = '93' THEN '易订货' WHEN `platform_id` = '94' THEN '天猫国际直营(轻轨三号线)' WHEN `platform_id` = '96' THEN '驿氪' WHEN `platform_id` = '97' THEN '妈妈良品' WHEN `platform_id` = '98' THEN '小芒电商' WHEN `platform_id` = '99' THEN '卡美啦' WHEN `platform_id` = '100' THEN '年丰大当家' WHEN `platform_id` = '101' THEN '得物' WHEN `platform_id` = '102' THEN '考拉商家直发' WHEN (`platform_id` = '103' AND `sub_platform_id` = '0') THEN '美团闪购-团好货' WHEN (`platform_id` = '103' AND `sub_platform_id` = '1') THEN '美团闪购-医药健康' WHEN `platform_id` = '104' THEN '新华书店' WHEN `platform_id` = '105' THEN '云货优选' WHEN `platform_id` = '106' THEN '零售通' WHEN `platform_id` = '107' THEN '易久批' WHEN `platform_id` = '108' THEN '腾讯惠聚' WHEN `platform_id` = '109' THEN '小鹅拼拼' WHEN `platform_id` = '110' THEN '度小店' WHEN `platform_id` = '111' THEN '枫页小店' WHEN `platform_id` = '112' THEN '丁香妈妈' WHEN `platform_id` = '113' THEN '药师帮' WHEN `platform_id` = '114' THEN '峰雷' WHEN `platform_id` = '115' THEN 'SHEIN希音' WHEN `platform_id` = '116' THEN 'bilibili会员购' WHEN `platform_id` = '117' THEN '群接龙' WHEN `platform_id` = '118' THEN '招商银行掌上生活' WHEN `platform_id` = '119' THEN '华为商城' WHEN `platform_id` = '120' THEN '微信连接器' WHEN `platform_id` = '121' THEN '单创VTN' WHEN `platform_id` = '125' THEN '分销' WHEN (`platform_id` = '126' AND `sub_platform_id` = '1') THEN '定制-启博微分销' WHEN (`platform_id` = '126' AND `sub_platform_id` = '2') THEN '定制-Farfetch' WHEN (`platform_id` = '126' AND `sub_platform_id` = '3') THEN '定制-寺库' WHEN (`platform_id` = '126' AND `sub_platform_id` = '4') THEN '定制-分期乐' WHEN (`platform_id` = '126' AND `sub_platform_id` = '5') THEN '定制-邮乐网' WHEN (`platform_id` = '126' AND `sub_platform_id` = '6') THEN '定制-脉宝云' WHEN (`platform_id` = '126' AND `sub_platform_id` = '7') THEN '定制-好物满仓' WHEN (`platform_id` = '126' AND `sub_platform_id` = '8') THEN '定制-微一案' WHEN (`platform_id` = '126' AND `sub_platform_id` = '9') THEN '定制-零购' WHEN (`platform_id` = '126' AND `sub_platform_id` = '10') THEN '定制-执御' WHEN (`platform_id` = '126' AND `sub_platform_id` = '11') THEN '定制-洋码头' WHEN (`platform_id` = '126' AND `sub_platform_id` = '12') THEN '定制-亲宝宝' WHEN (`platform_id` = '126' AND `sub_platform_id` = '13') THEN '定制-秀购' WHEN (`platform_id` = '126' AND `sub_platform_id` = '14') THEN '定制-萌推' WHEN (`platform_id` = '126' AND `sub_platform_id` = '15') THEN '定制-环球好货' WHEN (`platform_id` = '126' AND `sub_platform_id` = '16') THEN '定制-一条' WHEN (`platform_id` = '126' AND `sub_platform_id` = '17') THEN '定制-孔夫子旧书网' WHEN (`platform_id` = '126' AND `sub_platform_id` = '18') THEN '定制-1899' WHEN (`platform_id` = '126' AND `sub_platform_id` = '19') THEN '定制-洋葱OMALL' WHEN (`platform_id` = '126' AND `sub_platform_id` = '20') THEN '定制-毒' WHEN (`platform_id` = '126' AND `sub_platform_id` = '21') THEN '定制-棒棒糖' WHEN (`platform_id` = '126' AND `sub_platform_id` = '22') THEN '定制-越洋店铺' WHEN (`platform_id` = '126' AND `sub_platform_id` = '23') THEN '定制-购书云' WHEN (`platform_id` = '126' AND `sub_platform_id` = '24') THEN '定制-公主购' WHEN (`platform_id` = '126' AND `sub_platform_id` = '25') THEN '定制-康爱多' WHEN (`platform_id` = '126' AND `sub_platform_id` = '26') THEN '定制-年糕妈妈' WHEN (`platform_id` = '126' AND `sub_platform_id` = '27') THEN '定制-see小店' WHEN (`platform_id` = '126' AND `sub_platform_id` = '27') THEN '定制-部落管家' WHEN `platform_id` = '128' THEN '猫享考拉自营' WHEN `platform_id` = '138' THEN '震坤行' WHEN `platform_id` = '139' THEN '抖音供销' WHEN `platform_id` = '140' THEN '顺联动力' WHEN `platform_id` = '141' THEN '行云货仓' WHEN `platform_id` = '146' THEN '百度健康' ELSE '未知' END AS `channel`, IF(LOCATE(' ', `receiver_area`), SPLIT_PART(`receiver_area`, ' ' , 1), IF(1 = 1, `receiver_area`, NULL)) AS `receive_province`, IF(LOCATE(' ', `receiver_area`), SPLIT_PART(`receiver_area`, ' ' , 2), IF(2 = 1, `receiver_area`, NULL)) AS `receive_city`, IF(LOCATE(' ', `receiver_area`), SPLIT_PART(`receiver_area`, ' ' , 3), IF(3 = 1, `receiver_area`, NULL)) AS `receive_district`, CAST(CAST(`order_detail` AS JSON) -> 'goods_id' AS VARCHAR) AS `product_id`, CAST(CAST(`order_detail` AS JSON) -> 'spec_id' AS VARCHAR) AS `spec_id`, CAST(CAST(`order_detail` AS JSON) -> 'suite_no' AS VARCHAR) AS `suite_code`, CAST(CAST(`order_detail` AS JSON) -> 'suite_name' AS VARCHAR) AS `suite_name`, CAST(CAST(`order_detail` AS JSON) -> 'goods_no' AS VARCHAR) AS `product_code`, CAST(CAST(`order_detail` AS JSON) -> 'goods_name' AS VARCHAR) AS `product_name`, CAST(CAST(`order_detail` AS JSON) -> 'api_goods_name' AS VARCHAR) AS `palt_product_name`, CAST(CAST(`order_detail` AS JSON) -> 'spec_no' AS VARCHAR) AS `spec_code`, CAST(CAST(`order_detail` AS JSON) -> 'spec_name' AS VARCHAR) AS `spec_name`, CAST(CAST(CAST(`order_detail` AS JSON) -> 'num' AS VARCHAR) AS FLOAT) AS `sale_num`, CAST(CAST(CAST(`order_detail` AS JSON) -> 'price' AS VARCHAR) AS FLOAT) AS `sale_price`, CAST(CAST(CAST(CAST(CAST(`order_detail` AS JSON) -> 'num' AS VARCHAR) AS FLOAT) AS DECIMAL(38, 8)) * CAST(CAST(CAST(CAST(`order_detail` AS JSON) -> 'price' AS VARCHAR) AS FLOAT) AS DECIMAL(38, 8)) AS DECIMAL(38, 8)) AS `sale_amount`, CAST(CAST(CAST(`order_detail` AS JSON) -> 'discount' AS VARCHAR) AS FLOAT) AS `sale_discount`, CAST(`post_amount` AS DECIMAL(38, 8)) AS `sale_post`, CASE WHEN CAST(CAST(`order_detail` AS JSON) -> 'gift_type' AS VARCHAR) = '0' THEN '否' ELSE '是' END AS `is_gift`, CAST(CASE WHEN (CAST(`trade_time` AS DECIMAL(38, 8)) / 1000) > 99999999999 THEN CAST(FROM_UNIXTIME((CAST(`trade_time` AS DECIMAL(38, 8)) / 1000) / 1000) AS DATETIME) WHEN (CAST(`trade_time` AS DECIMAL(38, 8)) / 1000) < 30000000 THEN str_to_date((CAST(`trade_time` AS DECIMAL(38, 8)) / 1000), '%Y%m%d') ELSE CAST(FROM_UNIXTIME((CAST(`trade_time` AS DECIMAL(38, 8)) / 1000)) AS DATETIME) END AS VARCHAR) AS `order_time`, CAST(CASE WHEN (CAST(`consign_time` AS DECIMAL(38, 8)) / 1000) > 99999999999 THEN CAST(FROM_UNIXTIME((CAST(`consign_time` AS DECIMAL(38, 8)) / 1000) / 1000) AS DATETIME) WHEN (CAST(`consign_time` AS DECIMAL(38, 8)) / 1000) < 30000000 THEN str_to_date((CAST(`consign_time` AS DECIMAL(38, 8)) / 1000), '%Y%m%d') ELSE CAST(FROM_UNIXTIME((CAST(`consign_time` AS DECIMAL(38, 8)) / 1000)) AS DATETIME) END AS VARCHAR) AS `send_time`, CASE WHEN `remark_flag` = '1' THEN '红' WHEN `remark_flag` = '2' THEN '黄' WHEN `remark_flag` = '3' THEN '绿' WHEN `remark_flag` = '4' THEN '蓝' WHEN `remark_flag` = '5' THEN '紫' ELSE `remark_flag` END AS `seller_flag`, CAST(CAST(`order_detail` AS JSON) -> 'remark' AS VARCHAR) AS `remark`, CAST(CAST(CAST(`order_detail` AS JSON) -> 'share_amount' AS VARCHAR) AS DECIMAL(38, 8)) AS `share_amount`, CASE WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '0' THEN '无退款' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '1' THEN '取消退款' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '2' THEN '申请退款' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '3' THEN '待退款' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '4' THEN '待还原' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '5' THEN '退款成功' WHEN CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) = '6' THEN '已退(未付款关闭,未付款的取消了)' ELSE CAST(CAST(`order_detail` AS JSON) -> 'refund_status' AS VARCHAR) END AS `refund_status`
FROM (SELECT `consign_time`, `customer_no`, `fenxiao_nick`, `logistics_code`, `logistics_name`, `logistics_no`, `modified`, `order_detail`, `pay_time`, `platform_id`, `post_amount`, `receiver_area`, `remark_flag`, `salesman_name`, `shop_no`, `sub_platform_id`, `trade_from`, `trade_id`, `trade_label`, `trade_no`, `trade_status`, `trade_time`, `trade_type`, `warehouse_no`, `detail_rec_id`, ROW_NUMBER() OVER (PARTITION BY `trade_id`, `detail_rec_id` ORDER BY `modified` IS NULL DESC, `modified` DESC) AS `w0$o0`
FROM (SELECT `consign_time` AS `consign_time`, `customer_no` AS `customer_no`, `fenxiao_nick` AS `fenxiao_nick`, `logistics_code` AS `logistics_code`, `logistics_name` AS `logistics_name`, `logistics_no` AS `logistics_no`, `modified` AS `modified`, `order_detail` AS `order_detail`, `pay_time` AS `pay_time`, `platform_id` AS `platform_id`, `post_amount` AS `post_amount`, `receiver_area` AS `receiver_area`, `remark_flag` AS `remark_flag`, `salesman_name` AS `salesman_name`, `shop_no` AS `shop_no`, `sub_platform_id` AS `sub_platform_id`, `trade_from` AS `trade_from`, `trade_id` AS `trade_id`, `trade_label` AS `trade_label`, `trade_no` AS `trade_no`, `trade_status` AS `trade_status`, `trade_time` AS `trade_time`, `trade_type` AS `trade_type`, `warehouse_no` AS `warehouse_no`, `detail_rec_id`
FROM (SELECT `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`consign_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`customer_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`fenxiao_nick`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_code`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`logistics_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`modified`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_detail`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`pay_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`platform_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`post_amount`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`receiver_area`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`remark_flag`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`salesman_name`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`shop_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`sub_platform_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_from`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_id`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_label`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_no`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_status`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_time`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`trade_type`, `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`warehouse_no`, CAST(CAST(`ods_api_wdtqjqm_sale_order_info_f_tmp1`.`order_detail` AS JSON) -> 'rec_id' AS VARCHAR) AS `detail_rec_id`
FROM `cubeappdata`.`ods_api_wdtqjqm_sale_order_info_f_tmp1`) AS `ods_api_wdtqjqm_sale_order_info_f_tmp1`) AS `ods_api_wdtqjqm_sale_order_info_f_tmp1`) AS `ods_api_wdtqjqm_sale_order_info_f_tmp1`
WHERE `w0$o0` = 1) AS `ods_api_wdtqjqm_sale_order_info_f_tmp1`) AS `ods_api_wdtqjqm_sale_order_info_f_tmp1`
LEFT JOIN (SELECT `ods_api_wdtqjqm_shop_info_f`.`shop_name`, `ods_api_wdtqjqm_shop_info_f`.`shop_no`
FROM `cubeappdata`.`ods_api_wdtqjqm_shop_info_f`) AS `ods_api_wdtqjqm_shop_info_f` ON `ods_api_wdtqjqm_sale_order_info_f_tmp1`.`shop_no` = `ods_api_wdtqjqm_shop_info_f`.`shop_no`) AS `t`
LEFT JOIN (SELECT `ods_api_wdtqjqm_warehouse_info_f`.`warehouse_no`, `ods_api_wdtqjqm_warehouse_info_f`.`name`
FROM `cubeappdata`.`ods_api_wdtqjqm_warehouse_info_f`) AS `ods_api_wdtqjqm_warehouse_info_f` ON `t`.`warehouse_no` = `ods_api_wdtqjqm_warehouse_info_f`.`warehouse_no`) AS `t0`) AS `t2`) AS `t4`;
query dump在附件中
【背景】做过哪些操作?
【业务影响】
【是否存算分离】
【StarRocks版本】例如:3.3.2
【集群规模】例如:3fe(3 follower)+3be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:32C/64G/万兆
【联系方式】为了在解决问题过程中能及时联系到您获取一些日志信息,请补充下您的联系方式,例如:社区群16-可乐鸡或者邮箱,谢谢
【附件】
-
fe.log/beINFO/相应截图
-
慢查询:
- Profile信息
- 并行度:show variables like ‘%parallel_fragment_exec_instance_num%’;
- pipeline是否开启:show variables like ‘%pipeline%’;
- be节点cpu和内存使用率截图
-
查询报错:
- query_dump,怎么获取query_dump文件
dump_file (127.5 KB)
- query_dump,怎么获取query_dump文件
-
be crash
- be.out
-
外表查询报错
- be.out和fe.warn.log