Skip to content

Commit

Permalink
codec(ticdc): simple avro refinement (#10490)
Browse files Browse the repository at this point in the history
close #10489
  • Loading branch information
3AceShowHand authored Jan 19, 2024
1 parent 33436f9 commit 2f529bf
Show file tree
Hide file tree
Showing 5 changed files with 424 additions and 152 deletions.
145 changes: 114 additions & 31 deletions examples/java/src/main/resources/schema.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,38 @@
},
{
"name": "decimal",
"type": "int",
"default": 0
"type": [
"null",
"int"
],
"default": null
},
{
"name": "elements",
"type": {
"type": "array",
"items": "string"
}
"type": [
"null",
{
"type": "array",
"items": "string"
}
],
"default": null
},
{
"name": "unsigned",
"type": "boolean"
"type": [
"null",
"boolean"
],
"default": null
},
{
"name": "zerofill",
"type": "boolean"
"type": [
"null",
"boolean"
],
"default": null
}
]
},
Expand All @@ -63,12 +78,13 @@
},
{
"name": "default",
"type": ["null", "string"]

"type": [
"null",
"string"
]
}
]
},

{
"namespace": "com.pingcap.simple.avro",
"name": "IndexSchema",
Expand Down Expand Up @@ -100,7 +116,6 @@
}
]
},

{
"namespace": "com.pingcap.simple.avro",
"name": "TableSchema",
Expand Down Expand Up @@ -139,7 +154,6 @@
}
]
},

{
"namespace": "com.pingcap.simple.avro",
"name": "Checksum",
Expand Down Expand Up @@ -224,7 +238,20 @@
},
{
"name": "type",
"type": "string"
"type": {
"type": "enum",
"name": "DDLType",
"symbols": [
"CREATE",
"ALTER",
"ERASE",
"RENAME",
"TRUNCATE",
"CINDEX",
"DINDEX",
"QUERY"
]
}
},
{
"name": "sql",
Expand All @@ -240,12 +267,18 @@
},
{
"name": "tableSchema",
"type": ["null", "com.pingcap.simple.avro.TableSchema"],
"type": [
"null",
"com.pingcap.simple.avro.TableSchema"
],
"default": null
},
{
"name": "preTableSchema",
"type": ["null", "com.pingcap.simple.avro.TableSchema"],
"type": [
"null",
"com.pingcap.simple.avro.TableSchema"
],
"default": null
}
]
Expand Down Expand Up @@ -298,37 +331,87 @@
},
{
"name": "claimCheckLocation",
"type": "string",
"default": ""
"type": [
"null",
"string"
],
"default": null
},
{
"name": "handleKeyOnly",
"type": "boolean",
"default": false
"type": [
"null",
"boolean"
],
"default": null
},
{
"name": "checksum",
"type": ["null", "com.pingcap.simple.avro.Checksum"],
"type": [
"null",
"com.pingcap.simple.avro.Checksum"
],
"default": null
},
{
"name": "data",
"type": ["null", {
"type": "map",
"values": ["null", "int", "long", "float", "double", "string", "boolean", "bytes"],
"default": null
}],
"type": [
"null",
{
"type": "map",
"values": [
"null",
"int",
"long",
"float",
"double",
"string",
"boolean",
"bytes"
],
"default": null
}
],
"default": null
},
{
"name": "old",
"type": ["null", {
"type": "map",
"values": ["null", "int", "long", "float", "double", "string", "boolean", "bytes"],
"default": null
}],
"type": [
"null",
{
"type": "map",
"values": [
"null",
"int",
"long",
"float",
"double",
"string",
"boolean",
"bytes"
],
"default": null
}
],
"default": null
}
]
},
{
"namespace": "com.pingcap.simple.avro",
"name": "Message",
"docs": "the wrapper for all kind of messages",
"type": "record",
"fields": [
{
"name": "payload",
"type": [
"com.pingcap.simple.avro.Watermark",
"com.pingcap.simple.avro.Bootstrap",
"com.pingcap.simple.avro.DDL",
"com.pingcap.simple.avro.DML"
]
}
]
}
]
Loading

0 comments on commit 2f529bf

Please sign in to comment.