|
@@ -3,6 +3,10 @@
|
|
|
"""
|
|
"""
|
|
|
Hive DDL 生成器(raw 层;ods 层占位待实施)。
|
|
Hive DDL 生成器(raw 层;ods 层占位待实施)。
|
|
|
|
|
|
|
|
|
|
+**仅支持 PG 源**:reader.dataSource 必须是 `postgresql/{env}-{instance}`
|
|
|
|
|
+形式;mysql 等其他源由复用的 datax-sync-template-gen.resolve_datasource
|
|
|
|
|
+直接 NotImplementedError。
|
|
|
|
|
+
|
|
|
输入 sync ini,从 PG 抽字段中文注释,按 reader.column 顺序渲染
|
|
输入 sync ini,从 PG 抽字段中文注释,按 reader.column 顺序渲染
|
|
|
全字段 STRING + dt STRING 分区 + ORC + EXTERNAL TABLE,写到 stdout
|
|
全字段 STRING + dt STRING 分区 + ORC + EXTERNAL TABLE,写到 stdout
|
|
|
(传 -o 时额外落盘 {table_name}_create.sql)。
|
|
(传 -o 时额外落盘 {table_name}_create.sql)。
|
|
@@ -149,7 +153,7 @@ def render_raw_ddl(table_name, columns, comment_dict):
|
|
|
for i, col in enumerate(columns):
|
|
for i, col in enumerate(columns):
|
|
|
comma = ',' if i < last_idx else ''
|
|
comma = ',' if i < last_idx else ''
|
|
|
comment = comment_dict.get(col, '').replace("'", "''")
|
|
comment = comment_dict.get(col, '').replace("'", "''")
|
|
|
- lines.append(" {col:<{w}}STRING{comma} COMMENT '{comment}'".format(
|
|
|
|
|
|
|
+ lines.append(" {col:<{w}}STRING COMMENT '{comment}'{comma}".format(
|
|
|
col=col, w=width, comma=comma, comment=comment))
|
|
col=col, w=width, comma=comma, comment=comment))
|
|
|
lines.extend([
|
|
lines.extend([
|
|
|
')',
|
|
')',
|