This commit is contained in:
HuangHai
2026-02-05 15:25:57 +08:00
parent 06fe23ff6e
commit 4592b0da6f
2 changed files with 7 additions and 4 deletions

View File

@@ -98,7 +98,10 @@ for JOB in "${JOBS[@]}"; do
PRE_SQL="TRUNCATE TABLE $TABLE_NAME"
# 注意:这里需要仔细处理参数引用,将变量作为整体传递
PARAMS="$SRC_BASE_PARAMS $DEST_PARAMS -Dsrc_query_sql=\"$QUERY_SQL\" -Ddest_pre_sql=\"$PRE_SQL\""
# 优化:全量同步时表已清空,强制使用 insert 模式以提升性能(覆盖 db_config.sh 中的 replace 模式)
OPTIMIZED_DEST_PARAMS="${DEST_PARAMS/dest_write_mode=replace/dest_write_mode=insert}"
PARAMS="$SRC_BASE_PARAMS $OPTIMIZED_DEST_PARAMS -Dsrc_query_sql=\"$QUERY_SQL\" -Ddest_pre_sql=\"$PRE_SQL\""
# 打印最终的执行命令(去除敏感信息后),用于调试
# echo "执行命令: python $DATAX_PY -p \"$PARAMS\" $JOB"