|
|
1 неделя назад | |
|---|---|---|
| .. | ||
| ddl | 1 неделя назад | |
| README.md | 1 неделя назад | |
| export_user_cert_info.ini | 1 неделя назад | |
端到端验证 Hive test.raw_usr_app_user_cert_info_inc_d(dt=20260422 分区)→ PG test.ads_usr_app_user_cert_info_export 回写。
闭环:先前 hive-import 冒烟把 PG public.app_user_cert_info 同步到 Hive raw 分区;本冒烟再把 Hive raw 分区数据回写到 PG 另一张表,验证 datax-hdfs-export-starter 端到端。
test.raw_usr_app_user_cert_info_inc_d 表 dt=20260422 分区里有数据dev-poyee-xiaoxu 实例对 hs_sync_data 库 test schema 有写权限datasource/ + /opt/datax 同步到 cdhmaster02 / cdhnode01-03-random 生效所需)ddl/pg_target.sql 建目标表(含 CREATE SCHEMA IF NOT EXISTS test + 建表)跑 DataX:
python3 bin/datax-hdfs-export-starter.py \
-ini tests/integration/datax/hdfs_export/export_user_cert_info.ini \
-start-date 20260422 -stop-date 20260423 \
-random
(start-date 用作 hdfsreader 的 ${dt} 占位符替换,读 Hive 分区 dt=20260422)
test.ads_usr_app_user_cert_info_export 表被 TRUNCATE 后插入数据test.raw_usr_app_user_cert_info_inc_d 的 dt=20260422 分区行数cert_birthday 字段值形如 "1990-05"(Hive raw 层已脱敏到月)user_cert_data / cert_no / cert_real_name 三个敏感字段(原本就没同步进 Hive)PG 侧:
SELECT COUNT(*) FROM test.ads_usr_app_user_cert_info_export;
SELECT id, user_id, cert_birthday, create_time
FROM test.ads_usr_app_user_cert_info_export
LIMIT 5;
Hive 侧对比:
SELECT COUNT(*) FROM test.raw_usr_app_user_cert_info_inc_d WHERE dt='20260422';
两边 COUNT 一致 = 冒烟通过。
ddl/pg_target.sql:PG 目标表建表 SQLexport_user_cert_info.ini:DataX ini