[Feature][Format] Improve maxwell_json,canal_json,debezium_json format add ts_ms and table#9701
Conversation
|
cc @wubx |
| // and we don't need "old" , because can not support UPDATE_BEFORE,UPDATE_AFTER | ||
| return new SeaTunnelRowType( | ||
| new String[] {"data", "type"}, | ||
| new String[] {"data", "type", "tableId", "ts"}, |
There was a problem hiding this comment.
The cancel format is database and table fields, not tableId. Please refer https://docs.pingcap.com/zh/tidb/stable/ticdc-canal-json/#dml-event
There was a problem hiding this comment.
The cancel format is database and table fields, not tableId. Please refer https://docs.pingcap.com/zh/tidb/stable/ticdc-canal-json/#dml-event
SeaTunnelRow do not have database and table fields, if use tableId to get db fields,may be get error data,remove it,only add ts field?
There was a problem hiding this comment.
We should update SeaTunnelRowType to CatalogTable in
Then we can get table and database from CatalogTable.
| return new SeaTunnelRowType( | ||
| new String[] {"before", "after", "op"}, | ||
| new SeaTunnelDataType[] {databaseSchema, databaseSchema, STRING_TYPE}); | ||
| new String[] {"before", "after", "op", "tableId", "ts_ms"}, |
There was a problem hiding this comment.
The debezium format doesn't contains tableId. Please refer https://help.aliyun.com/zh/flink/debezium
| return new SeaTunnelRowType( | ||
| new String[] {"data", "type"}, | ||
| new SeaTunnelDataType[] {databaseSchema, STRING_TYPE}); | ||
| new String[] {"data", "type", "tableId", "ts"}, |
There was a problem hiding this comment.
same as canal, maxwell doesn'ts contains tableId too. Please refer https://help.aliyun.com/zh/flink/maxwell-format
| return new SeaTunnelRowType( | ||
| new String[] {"data", "type"}, | ||
| new SeaTunnelDataType[] {databaseSchema, STRING_TYPE}); | ||
| new String[] {"data", "type", "tableId", "op_ts"}, |
There was a problem hiding this comment.
ogg json doesn't contains tableId. Please refer https://help.aliyun.com/zh/datahub/developer-reference/ogg-for-big-data-kafka
| "{\"data\":{\"id\":111,\"name\":\"scooter\",\"description\":\"Big 2-wheel scooter \",\"weight\":5.17},\"type\":\"INSERT\"}", | ||
| "{\"data\":{\"id\":111,\"name\":\"scooter\",\"description\":\"Big 2-wheel scooter \",\"weight\":5.17},\"type\":\"DELETE\"}"); | ||
|
|
||
| "{\"data\":{\"id\":101,\"name\":\"scooter\",\"description\":\"Small 2-wheel scooter\",\"weight\":3.14},\"type\":\"INSERT\",\"table\":\"..test\",\"op_ts\":1589384406000}", |
There was a problem hiding this comment.
why table is
..test?
'..test' is because of db and schema is null
| } | ||
|
|
||
| if (row.getOptions() != null && row.getOptions().containsKey(EVENT_TIME.getName())) { | ||
| reuse.setField(4, row.getOptions().get(EVENT_TIME.getName())); |
There was a problem hiding this comment.
Should we standardize the precision of eventtime? I see that the unit is sometimes seconds and sometimes milliseconds. Can we standardize it to milliseconds?
There was a problem hiding this comment.
Could you add some comment in
There was a problem hiding this comment.
Could you add some comment in
i add it , and change metadata.md


Purpose of this pull request
close #9675
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide