File size: 2,753 Bytes
e8c001c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
CREATE DATABASE IF NOT EXISTS internal_platform_db;

-- Input table (simplified to key + filter columns)
CREATE TABLE IF NOT EXISTS internal_platform_db.t_report_wuid_detail_d_prestosql_008 (
  wuid STRING,
  product_id STRING,
  adgroup_id BIGINT,
  action_time BIGINT,
  crm_id BIGINT,
  creative_id BIGINT,
  ocpx_conversion_cnt BIGINT,
  optimization_goal INT,
  second_optimization_goal INT,
  roi_goal INT,
  product_type INT,
  site_set INT,
  crm_advertiser_industry_id BIGINT,
  label INT,
  partition_time BIGINT,
  ds BIGINT
) STORED AS ORC;

INSERT INTO TABLE internal_platform_db.t_report_wuid_detail_d_prestosql_008 VALUES
('wuid001', 'prod001', 10001, 20260608120000, 5001, 20001, 0, 105, 0, 7, 46, 21, 100, 1, 20260608, 20260608),
('wuid002', 'prod002', 10002, 20260608130000, 5002, 20002, 0, 603, 0, 7, 46, 21, 200, 0, 20260608, 20260608),
('wuid003', 'prod003', 10003, 20260608140000, 5003, 20003, 0, 105, 0, 7, 46, 21, 300, 1, 20260608, 20260608),
('wuid004', 'prod004', 10004, 20260608150000, 5004, 20004, 0, 603, 0, 7, 46, 21, 400, 0, 20260608, 20260608),
('wuid005', 'prod005', 10005, 20260608160000, 5005, 20005, 0, 105, 0, 7, 46, 21, 500, 1, 20260608, 20260608),
('wuid006', 'prod006', 10006, 20260608170000, 5006, 20006, 1, 105, 0, 7, 46, 21, 600, 0, 20260608, 20260608),
('wuid007', NULL, 10007, 20260608180000, 5007, 20007, 0, 105, 0, 7, 46, 21, 700, 0, 20260608, 20260608),
('wuid008', 'prod008', 10008, 20260608190000, 0, 20008, 0, 105, 0, 7, 46, 21, 800, 0, 20260608, 20260608),
('wuid009', 'prod009', 10009, 20260608200000, 5009, 0, 0, 105, 0, 7, 46, 21, 900, 0, 20260608, 20260608),
('wuid010', 'prod010', 10010, 20260608210000, 5010, 20010, 0, 200, 0, 7, 46, 21, 1000, 0, 20260608, 20260608),
('wuid011', 'prod011', 10011, 20260608220000, 5011, 20011, 0, 105, 1, 7, 46, 21, 1100, 0, 20260608, 20260608),
('wuid012', 'prod012', 10012, 20260608230000, 5012, 20012, 0, 105, 0, 5, 46, 21, 1200, 0, 20260608, 20260608),
('wuid013', 'prod013', 10013, 20260607120000, 5013, 20013, 0, 105, 0, 7, 46, 21, 1300, 0, 20260607, 20260607);

-- GT output table
CREATE TABLE IF NOT EXISTS internal_platform_db.sdk_sample_pay_neg_mini_prestosql_008 (
  wuid STRING,
  product_id STRING,
  adgroup_id BIGINT,
  action_time BIGINT,
  crm_id BIGINT,
  creative_id BIGINT,
  label INT,
  product_type INT,
  optimization_goal INT,
  roi_goal INT,
  partition_time BIGINT
) STORED AS ORC;

-- Candidate output table
CREATE TABLE IF NOT EXISTS internal_platform_db.sdk_sample_pay_neg_mini_cand_prestosql_008 (
  wuid STRING,
  product_id STRING,
  adgroup_id BIGINT,
  action_time BIGINT,
  crm_id BIGINT,
  creative_id BIGINT,
  label INT,
  product_type INT,
  optimization_goal INT,
  roi_goal INT,
  partition_time BIGINT
) STORED AS ORC;