数据库 数据校验写入等逻辑更新。

This commit is contained in:
Neo
2026-02-01 03:46:16 +08:00
parent 9948000b71
commit 076f5755ca
128 changed files with 494310 additions and 2819 deletions

View File

@@ -0,0 +1,397 @@
================================================================================
Table: billiards_dwd.dim_tenant_goods
Primary Key: tenant_goods_id, scd2_start_time
================================================================================
## COLUMNS
--------------------------------------------------------------------------------
tenant_goods_id: bigint | nullable=NO | PK
tenant_id: bigint | nullable=YES |
supplier_id: bigint | nullable=YES |
category_name: character varying(64) | nullable=YES |
goods_category_id: bigint | nullable=YES |
goods_second_category_id: bigint | nullable=YES |
goods_name: character varying(128) | nullable=YES |
goods_number: character varying(64) | nullable=YES |
unit: character varying(16) | nullable=YES |
market_price: numeric(18,2) | nullable=YES |
goods_state: integer | nullable=YES |
create_time: timestamp with time zone | nullable=YES |
update_time: timestamp with time zone | nullable=YES |
is_delete: integer | nullable=YES |
scd2_start_time: timestamp with time zone | nullable=NO | PK
scd2_end_time: timestamp with time zone | nullable=YES |
scd2_is_current: integer | nullable=YES |
scd2_version: integer | nullable=YES |
## VALUE ANALYSIS (for enum detection)
--------------------------------------------------------------------------------
tenant_goods_id:
Total: 171, Non-null: 171, Distinct: 171
Top values:
2792122952519557: 1
2792140384243589: 1
2792067181399941: 1
2823319050914565: 1
2792275329290117: 1
2792045494685573: 1
2792277093207941: 1
2792112367603589: 1
2792114975313797: 1
2792173195546501: 1
2792229617586053: 1
2792286937681797: 1
2792213125140357: 1
2802003111103429: 1
2792292119728005: 1
tenant_id:
Total: 171, Non-null: 171, Distinct: 1
*** LIKELY ENUM (distinct <= 15) ***
Top values:
2790683160709957: 171
supplier_id:
Total: 171, Non-null: 171, Distinct: 1
*** LIKELY ENUM (distinct <= 15) ***
Top values:
0: 171
category_name:
Total: 171, Non-null: 171, Distinct: 14
*** LIKELY ENUM (distinct <= 15) ***
Top values:
零食: 47
饮料: 38
其他2: 18
香烟: 17
雪糕: 14
酒水: 9
球杆: 8
槟榔: 6
小吃: 4
面: 3
果盘: 2
洋酒: 2
皮头: 2
其他: 1
goods_category_id:
Total: 171, Non-null: 171, Distinct: 9
*** LIKELY ENUM (distinct <= 15) ***
Top values:
2791941988405125: 50
2790683528350539: 49
2793217944864581: 18
2792062778003333: 17
2791942087561093: 14
2790683528350535: 11
2790683528350533: 6
2793220945250117: 4
2790683528350545: 2
goods_second_category_id:
Total: 171, Non-null: 171, Distinct: 14
*** LIKELY ENUM (distinct <= 15) ***
Top values:
2791948300259205: 47
2790683528350540: 38
2793218343257925: 18
2792063209623429: 17
2792035069284229: 14
2790683528350541: 9
2790683528350537: 8
2790683528350534: 6
2793221283104581: 4
2793236829620037: 3
2792050275864453: 2
2790683528350536: 2
2793221553489733: 2
2790683528350538: 1
goods_name:
Total: 171, Non-null: 171, Distinct: 171
Top values:
鱼蛋: 1
哇哈哈矿泉水: 1
卫龙魔芋爽: 1
哇哈哈AD钙奶: 1
奥利奥迷你可可: 1
卫龙大面筋: 1
香辣鱼皮: 1
科罗娜啤酒275ml: 1
旺旺碎冰冰: 1
黑松露苏打饼干: 1
皮尔力SY系列: 1
美汁源果粒橙: 1
软玉溪: 1
鱼豆腐: 1
营养快线: 1
goods_number:
Total: 171, Non-null: 171, Distinct: 171
Top values:
118: 1
123: 1
8: 1
75: 1
96: 1
129: 1
13: 1
144: 1
121: 1
113: 1
93: 1
94: 1
95: 1
34: 1
115: 1
unit:
Total: 171, Non-null: 171, Distinct: 13
*** LIKELY ENUM (distinct <= 15) ***
Top values:
包: 63
瓶: 49
个: 17
份: 14
根: 10
杯: 5
盒: 4
桶: 3
盘: 2
罐: 1
支: 1
双: 1
张: 1
goods_state:
Total: 171, Non-null: 171, Distinct: 2
*** LIKELY ENUM (distinct <= 15) ***
Top values:
1: 165
2: 6
is_delete:
Total: 171, Non-null: 171, Distinct: 1
*** LIKELY ENUM (distinct <= 15) ***
Top values:
0: 171
scd2_is_current:
Total: 171, Non-null: 171, Distinct: 1
*** LIKELY ENUM (distinct <= 15) ***
Top values:
1: 171
scd2_version:
Total: 171, Non-null: 171, Distinct: 1
*** LIKELY ENUM (distinct <= 15) ***
Top values:
1: 171
## SAMPLE DATA (first 10 rows)
--------------------------------------------------------------------------------
Columns: ['tenant_goods_id', 'tenant_id', 'supplier_id', 'category_name', 'goods_category_id', 'goods_second_category_id', 'goods_name', 'goods_number', 'unit', 'market_price', 'goods_state', 'create_time', 'update_time', 'is_delete', 'scd2_start_time', 'scd2_end_time', 'scd2_is_current', 'scd2_version']
Row 1:
tenant_goods_id: 2792114975313797
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 海之言
goods_number: 35
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:26:16+08:00
update_time: 2025-11-10 18:35:33+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 2:
tenant_goods_id: 2792120662675333
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 西梅多多饮品
goods_number: 41
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:32:03+08:00
update_time: 2025-11-10 18:38:16+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 3:
tenant_goods_id: 2792123803078533
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 美汁源果粒橙
goods_number: 43
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:35:15+08:00
update_time: 2025-11-10 18:39:03+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 4:
tenant_goods_id: 2792125002321797
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 三诺橙汁
goods_number: 44
unit: 瓶
market_price: 18.00
goods_state: 1
create_time: 2025-07-15 20:36:28+08:00
update_time: 2025-11-10 18:39:20+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 5:
tenant_goods_id: 2792126153330565
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 营养快线
goods_number: 45
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:37:38+08:00
update_time: 2025-11-10 18:39:33+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 6:
tenant_goods_id: 2792126853369733
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 东鹏特饮
goods_number: 46
unit: 瓶
market_price: 7.00
goods_state: 1
create_time: 2025-07-15 20:38:21+08:00
update_time: 2025-11-10 18:40:07+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 7:
tenant_goods_id: 2792128158191493
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 农夫山泉苏打水
goods_number: 47
unit: 瓶
market_price: 6.00
goods_state: 1
create_time: 2025-07-15 20:39:40+08:00
update_time: 2025-11-10 18:41:52+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 8:
tenant_goods_id: 2792128793546629
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 椰汁
goods_number: 48
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:40:19+08:00
update_time: 2025-11-10 18:42:13+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 9:
tenant_goods_id: 2792129791594373
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 芬达
goods_number: 49
unit: 瓶
market_price: 5.00
goods_state: 1
create_time: 2025-07-15 20:41:20+08:00
update_time: 2025-11-10 18:42:31+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1
Row 10:
tenant_goods_id: 2792130734133125
tenant_id: 2790683160709957
supplier_id: 0
category_name: 饮料
goods_category_id: 2790683528350539
goods_second_category_id: 2790683528350540
goods_name: 屈臣氏苏打水
goods_number: 50
unit: 瓶
market_price: 8.00
goods_state: 1
create_time: 2025-07-15 20:42:18+08:00
update_time: 2025-11-10 18:42:50+08:00
is_delete: 0
scd2_start_time: 2025-12-14 21:20:28.731914+08:00
scd2_end_time: 9999-12-31 00:00:00+08:00
scd2_is_current: 1
scd2_version: 1