relational.write
写入与 SQL 兼容的数据存储
写入与 SQL 兼容的数据存储
性能
名字 | 类型 | 描述 | 必填 |
---|---|---|---|
connection (用于加载的连接) |
string |
connections.yaml 中定义的逻辑连接名称 |
是的 |
schema (目标表的表 Schema) |
string |
如果留空,则此连接的默认架构将按照 connections.yaml 中的定义使用 |
是的 |
table (目标表名) |
string |
目标表名称 |
是的 |
keys (在 'load_strategy' 是 UPSERT 或与 'opcode_field' 一起使用时使用的业务密钥) |
array |
不 | |
mapping (要写入的字段) |
array |
不 | |
foreach (使用 JMESPath 表达式将一列拆分为多条记录) |
string |
使用 JMESPath 表达式将列拆分为多条记录。表达式应位于 format 列: expression 中。 模式: ^(?!:).*:.*(?<!:)$ |
不 |
opcode_field | string |
负载中保存数据库中此记录的作(c - 创建、d - 删除、u - 更新)的字段名称 |
不 |
load_strategy | string |
目标 类型 默认值: "APPEND" 枚举: "APPEND" ,"REPLACE" ,"UPSERT" ,"TYPE2" |
不 |
active_record_indicator | string |
用于TYPE2 load_strategy。用于标识哪些行处于活动状态的 SQL 表达式 |
不 |
inactive_record_mapping (用于 'TYPE2' load_strategy。用于关闭活动记录的列映射) |
array |
要使用的列列表。对源使用任何有效的 SQL 表达式。如果省略 'target' ,则默认为源列 Default 的名称: |
不 |
其他属性:不允许
无属性。
Not [required1]:无属性。
例
id: load_snowflake
type: relational.write
properties:
connection: eu_datalake
table: employees
schema: dbo
load_strategy: APPEND
keys[]: Business keys to use in case of `load_strategy` is UPSERT or working with `opcode_field`
Items: name of column
No properties.
Example
- fname
- lname: last_name
mapping[]: Fields to write
Items: name of column
No properties.
Example
- fname
- lname: last_name
- address
- gender
inactive_record_mapping[]: Used for `TYPE2` load_strategy. The columns mapping to use to close out an active record
A list of columns to use. Use any valid SQL expression for the source. If 'target' is omitted, will default to the name of the source column
No properties.
Example
- source: CURRENT_DATE
target: deletedAt
- source: "'Y'"
target: is_active
On this page