dicemy's picture
Upload 655 files
e8c001c verified
Raw
History Blame Contribute Delete
13.9 kB
CREATE DATABASE IF NOT EXISTS internal_platform_db;
-- Input table 1: ads_sec_ec_sup_ec_tele_item_hi
CREATE TABLE IF NOT EXISTS internal_platform_db.ads_sec_ec_sup_ec_tele_item_hi_query_engine_140 (
`p_hour` STRING,
`uniqu_id` STRING,
`id` STRING,
`name` STRING,
`sub_title` STRING,
`property` STRING,
`sku_list` STRING,
`desc_info` STRING,
`url` STRING,
`status` INT,
`sale_price` DOUBLE,
`sale_qty` BIGINT,
`stock_qty` BIGINT,
`score` DOUBLE,
`main_image_url` STRING,
`sub_image_url` STRING,
`category_level1_id` BIGINT,
`category_level1_name` STRING,
`category_level2_id` BIGINT,
`category_level2_name` STRING,
`category_level3_id` BIGINT,
`category_level3_name` STRING,
`shop_uniqu_id` STRING,
`shop_id` STRING,
`shop_name` STRING,
`shop_url` STRING,
`platform_id` INT,
`platform_name` STRING,
`shipping_address` STRING,
`price_text` STRING,
`flag` INT,
`need_cutpic` INT,
`is_ocr` INT,
`soe_flag` INT,
`data_channel` INT,
`data_method` INT,
`data_source` STRING,
`detail_image_url` STRING,
`service_guarantee` STRING,
`brand_id` INT,
`brand_name` STRING,
`is_ad` INT,
`is_selfoperated` INT,
`create_time` STRING,
`task_id` STRING,
`batch_id` STRING,
`category_level1_original` STRING,
`category_level2_original` STRING,
`category_level3_original` STRING,
`brand_name_original` STRING,
`product_name` STRING,
`approval_number` STRING,
`ccc_certificate_number` STRING,
`efficacy` STRING,
`production_place` STRING,
`manufacturer` STRING,
`production_license_number` STRING,
`factory_name` STRING,
`factory_address` STRING,
`brand_authorization_image_url` STRING,
`is_virtual` INT,
`is_invoice` INT,
`is_guarantee` INT,
`is_free_ship` INT,
`comments_cnt` BIGINT,
`industry_id` INT,
`industry_name` STRING,
`high_remark_cnt` BIGINT,
`med_remark_cnt` BIGINT,
`bad_remark_cnt` BIGINT,
`main_image_ocr` STRING,
`sub_image_ocr` STRING,
`detail_image_ocr` STRING,
`ml_category_tag` STRING,
`sku_cnt` INT,
`license_collection_status` INT,
`required_quality_score` BIGINT,
`core_quality_score` BIGINT,
`other_quality_score` BIGINT,
`screenshot_url` STRING,
`screenshot_seed_info` STRING,
`screenshot_flag` INT,
`job_id` STRING,
`data_method_keyword` STRING
) STORED AS ORC;
INSERT INTO TABLE internal_platform_db.ads_sec_ec_sup_ec_tele_item_hi_query_engine_140
(p_hour,uniqu_id,id,name,sub_title,property,sku_list,desc_info,url,status,sale_price,sale_qty,stock_qty,score,main_image_url,sub_image_url,category_level1_id,category_level1_name,category_level2_id,category_level2_name,category_level3_id,category_level3_name,shop_uniqu_id,shop_id,shop_name,shop_url,platform_id,platform_name,shipping_address,price_text,flag,need_cutpic,is_ocr,soe_flag,data_channel,data_method,data_source,detail_image_url,service_guarantee,brand_id,brand_name,is_ad,is_selfoperated,create_time,task_id,batch_id,category_level1_original,category_level2_original,category_level3_original,brand_name_original,product_name,approval_number,ccc_certificate_number,efficacy,production_place,manufacturer,production_license_number,factory_name,factory_address,brand_authorization_image_url,is_virtual,is_invoice,is_guarantee,is_free_ship,comments_cnt,industry_id,industry_name,high_remark_cnt,med_remark_cnt,bad_remark_cnt,main_image_ocr,sub_image_ocr,detail_image_ocr,ml_category_tag,sku_cnt,license_collection_status,required_quality_score,core_quality_score,other_quality_score,screenshot_url,screenshot_seed_info,screenshot_flag,job_id,data_method_keyword)
VALUES
(
'2026060801','uid_hi_001','item001','TestProduct1','subtitle1','prop1','sku1','desc1','http://url1',1,99.9,100,50,4.5,'http://img1','http://subimg1',1,'Cat1',2,'Cat2',3,'Cat3','shop_uniq1','shop001','ShopA','http://shop1',1,'PlatformA','Shanghai','99.9 yuan',1,1,1,1,1,1,'BC','http://detail1','service1',1,'BrandA',0,1,'2026-06-08 10:00:00','task001','batch001','OrigCat1','OrigCat2','OrigCat3','OrigBrandA','ProdNameA','AP001','CCC001','efficacy1','Shanghai','ManufA','LIC001','FactoryA','AddrA','http://brandauth1',0,1,1,1,500,1,'IndustryA',400,80,20,'ocr_main1','ocr_sub1','ocr_detail1','ml_tag1',5,1,20,15,10,'http://screenshot1','seed1',1,'job1','keyword1'
);
-- Input table 2: ads_sec_ec_sup_ec_tele_security_platform_lk_extensive_item
CREATE TABLE IF NOT EXISTS internal_platform_db.ads_sec_ec_sup_ec_tele_security_platform_lk_extensive_item_query_engine_140 (
`p_date` STRING,
`uniqu_id` STRING,
`id` STRING,
`name` STRING,
`sub_title` STRING,
`property` STRING,
`sku_list` STRING,
`desc_info` STRING,
`url` STRING,
`status` INT,
`price` DOUBLE,
`sale_qty` BIGINT,
`stock_qty` BIGINT,
`main_image_url` STRING,
`sub_image_url` STRING,
`category_level1_id` BIGINT,
`category_level1_name` STRING,
`category_level2_id` BIGINT,
`category_level2_name` STRING,
`category_level3_id` BIGINT,
`category_level3_name` STRING,
`shop_uniqu_id` STRING,
`shop_id` STRING,
`shop_name` STRING,
`shop_url` STRING,
`platform_id` INT,
`platform_name` STRING,
`shipping_address` STRING,
`price_text` STRING,
`flag` INT,
`need_cutpic` INT,
`is_ocr` INT,
`soe_flag` INT,
`data_channel` INT,
`data_method` INT,
`data_source` STRING,
`detail_image_url` STRING,
`service_guarantee` STRING,
`brand_id` INT,
`brand_name` STRING,
`is_ad` INT,
`is_selfoperated` INT,
`create_time` STRING,
`task_id` STRING,
`batch_id` STRING,
`category_level1_original` STRING,
`category_level2_original` STRING,
`category_level3_original` STRING,
`brand_name_original` STRING,
`product_name` STRING,
`approval_number` STRING,
`ccc_certificate_number` STRING,
`efficacy` STRING,
`production_place` STRING,
`manufacturer` STRING,
`production_license_number` STRING,
`factory_name` STRING,
`factory_address` STRING,
`brand_authorization_image_url` STRING,
`is_virtual` INT,
`is_invoice` INT,
`is_guarantee` INT,
`is_free_ship` INT,
`comments_cnt` BIGINT,
`industry_id` INT,
`industry_name` STRING,
`high_remark_cnt` BIGINT,
`med_remark_cnt` BIGINT,
`bad_remark_cnt` BIGINT,
`main_image_ocr` STRING,
`sub_image_ocr` STRING,
`detail_image_ocr` STRING,
`ml_category_tag` STRING,
`logo_brand` STRING,
`similarity_img_url` STRING,
`sku_cnt` INT,
`license_collection_status` INT,
`data_method_keyword` STRING,
`task_name` STRING,
`screenshot_url` STRING,
`required_quality_score` BIGINT,
`core_quality_score` BIGINT,
`other_quality_score` BIGINT,
`ext_province` STRING,
`ext_city` STRING,
`ext_area` STRING,
`ext_company_name` STRING,
`ext_company_province` STRING,
`ext_company_city` STRING,
`ext_company_area` STRING,
`ext_brand_category` STRING,
`ext_origin_url` STRING,
`ext_shop_addr` STRING
) STORED AS ORC;
INSERT INTO TABLE internal_platform_db.ads_sec_ec_sup_ec_tele_security_platform_lk_extensive_item_query_engine_140
VALUES
(
'20260608','uid_ext_001','item101','ExtProduct1','ext_sub1','ext_prop1','ext_sku1','ext_desc1','http://ext_url1',1,88.8,200,100,'http://ext_img1','http://ext_subimg1',10,'ExtCat1',20,'ExtCat2',30,'ExtCat3','ext_shop_uniq1','ext_shop001','ExtShopA','http://ext_shop1',2,'PlatformB','Beijing','88.8 yuan',0,1,0,0,2,2,'AL','http://ext_detail1','ext_service1',2,'BrandB',1,0,'2026-06-08 12:00:00','task101','batch101','ExtOrigCat1','ExtOrigCat2','ExtOrigCat3','ExtOrigBrandB','ExtProdName','AP101','CCC101','ext_efficacy','Beijing','ManufB','LIC101','FactoryB','AddrB','http://ext_brandauth1',1,0,0,1,300,2,'IndustryB',250,40,10,'ext_ocr_main1','ext_ocr_sub1','ext_ocr_detail1','ext_ml_tag1','LogoBrandB','http://similar1',3,2,'ext_keyword1','task_name1','http://ext_screenshot1',18,12,8,'Province1','City1','Area1','Company1','CompProvince1','CompCity1','CompArea1','BrandCat1','http://origin1','ShopAddr1'
);
-- Target table: ads_sec_ec_sup_ec_tele_item_score
CREATE TABLE IF NOT EXISTS internal_platform_db.ads_sec_ec_sup_ec_tele_item_score_query_engine_140 (
`uniqu_id` STRING,
`id_socre` INT,
`name_socre` INT,
`sub_title_socre` INT,
`property_socre` INT,
`sku_list_socre` INT,
`desc_info_socre` INT,
`url_socre` INT,
`status_socre` INT,
`price_socre` INT,
`sale_qty_socre` INT,
`stock_qty_socre` INT,
`main_image_url_socre` INT,
`sub_image_url_socre` INT,
`category_level1_id_socre` INT,
`category_level1_name_socre` INT,
`category_level2_id_socre` INT,
`category_level2_name_socre` INT,
`category_level3_id_socre` INT,
`category_level3_name_socre` INT,
`shop_uniqu_id_socre` INT,
`shop_id_socre` INT,
`shop_name_socre` INT,
`shop_url_socre` INT,
`platform_id_socre` INT,
`platform_name_socre` INT,
`shipping_address_socre` INT,
`price_text_socre` INT,
`flag_socre` INT,
`need_cutpic_socre` INT,
`is_ocr_socre` INT,
`soe_flag_socre` INT,
`data_channel_socre` INT,
`data_method_socre` INT,
`data_source_socre` INT,
`detail_image_url_socre` INT,
`service_guarantee_socre` INT,
`brand_id_socre` INT,
`brand_name_socre` INT,
`is_ad_socre` INT,
`is_selfoperated_socre` INT,
`create_time_socre` INT,
`task_id_socre` INT,
`batch_id_socre` INT,
`category_level1_original_socre` INT,
`category_level2_original_socre` INT,
`category_level3_original_socre` INT,
`brand_name_original_socre` INT,
`product_name_socre` INT,
`approval_number_socre` INT,
`ccc_certificate_number_socre` INT,
`efficacy_socre` INT,
`production_place_socre` INT,
`manufacturer_socre` INT,
`production_license_number_socre` INT,
`factory_name_socre` INT,
`factory_address_socre` INT,
`brand_authorization_image_url_socre` INT,
`is_virtual_socre` INT,
`is_invoice_socre` INT,
`is_guarantee_socre` INT,
`is_free_ship_socre` INT,
`comments_cnt_socre` INT,
`industry_id_socre` INT,
`industry_name_socre` INT,
`high_remark_cnt_socre` INT,
`med_remark_cnt_socre` INT,
`bad_remark_cnt_socre` INT,
`main_image_ocr_socre` INT,
`sub_image_ocr_socre` INT,
`detail_image_ocr_socre` INT,
`ml_category_tag_socre` INT,
`logo_brand_socre` INT,
`similarity_img_url_socre` INT,
`sku_cnt_socre` INT,
`license_collection_status_socre` INT,
`data_method_keyword_socre` INT,
`task_name_socre` INT,
`screenshot_url_socre` INT,
`required_quality_score` BIGINT,
`core_quality_score` BIGINT,
`other_quality_score` BIGINT,
`platform_name` STRING,
`source_type` STRING,
`is_exp` INT,
`is_off_shelf` INT
) PARTITIONED BY (`p_date` STRING) STORED AS ORC;
-- Agent 候选目标表
CREATE TABLE IF NOT EXISTS internal_platform_db.ads_sec_ec_sup_ec_tele_item_score_cand_query_engine_140 (
`uniqu_id` STRING,
`id_socre` INT,
`name_socre` INT,
`sub_title_socre` INT,
`property_socre` INT,
`sku_list_socre` INT,
`desc_info_socre` INT,
`url_socre` INT,
`status_socre` INT,
`price_socre` INT,
`sale_qty_socre` INT,
`stock_qty_socre` INT,
`main_image_url_socre` INT,
`sub_image_url_socre` INT,
`category_level1_id_socre` INT,
`category_level1_name_socre` INT,
`category_level2_id_socre` INT,
`category_level2_name_socre` INT,
`category_level3_id_socre` INT,
`category_level3_name_socre` INT,
`shop_uniqu_id_socre` INT,
`shop_id_socre` INT,
`shop_name_socre` INT,
`shop_url_socre` INT,
`platform_id_socre` INT,
`platform_name_socre` INT,
`shipping_address_socre` INT,
`price_text_socre` INT,
`flag_socre` INT,
`need_cutpic_socre` INT,
`is_ocr_socre` INT,
`soe_flag_socre` INT,
`data_channel_socre` INT,
`data_method_socre` INT,
`data_source_socre` INT,
`detail_image_url_socre` INT,
`service_guarantee_socre` INT,
`brand_id_socre` INT,
`brand_name_socre` INT,
`is_ad_socre` INT,
`is_selfoperated_socre` INT,
`create_time_socre` INT,
`task_id_socre` INT,
`batch_id_socre` INT,
`category_level1_original_socre` INT,
`category_level2_original_socre` INT,
`category_level3_original_socre` INT,
`brand_name_original_socre` INT,
`product_name_socre` INT,
`approval_number_socre` INT,
`ccc_certificate_number_socre` INT,
`efficacy_socre` INT,
`production_place_socre` INT,
`manufacturer_socre` INT,
`production_license_number_socre` INT,
`factory_name_socre` INT,
`factory_address_socre` INT,
`brand_authorization_image_url_socre` INT,
`is_virtual_socre` INT,
`is_invoice_socre` INT,
`is_guarantee_socre` INT,
`is_free_ship_socre` INT,
`comments_cnt_socre` INT,
`industry_id_socre` INT,
`industry_name_socre` INT,
`high_remark_cnt_socre` INT,
`med_remark_cnt_socre` INT,
`bad_remark_cnt_socre` INT,
`main_image_ocr_socre` INT,
`sub_image_ocr_socre` INT,
`detail_image_ocr_socre` INT,
`ml_category_tag_socre` INT,
`logo_brand_socre` INT,
`similarity_img_url_socre` INT,
`sku_cnt_socre` INT,
`license_collection_status_socre` INT,
`data_method_keyword_socre` INT,
`task_name_socre` INT,
`screenshot_url_socre` INT,
`required_quality_score` BIGINT,
`core_quality_score` BIGINT,
`other_quality_score` BIGINT,
`platform_name` STRING,
`source_type` STRING,
`is_exp` INT,
`is_off_shelf` INT
) PARTITIONED BY (`p_date` STRING) STORED AS ORC;