yunqingmoswu opened a new pull request, #6259:
URL: https://github.com/apache/inlong/pull/6259

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   Title: [INLONG-6256][Sort] Support debezium-json format with schema parse 
for DebeziumJsonDynamicSchemaFormat
   
   *(The following *XYZ* should be replaced by the actual [GitHub 
Issue](https://github.com/apache/inlong/issues) number)*
   
   Fixes #6256 
   
   ### Motivation
   
   Support debezium-json format with schema parse for 
DebeziumJsonDynamicSchemaFormat.
   A complete debezium format with schema will put metadata, physical fields, 
etc. in the payload, we also need to support parsing of this format and extract 
physical data, metadata, ddl, and etc. The data example as follows:
   ```{
     "schema": { 
       "type": "struct",
       "fields": [
         {
           "type": "struct",
           "fields": [
             {
               "type": "int32",
               "optional": false,
               "field": "id"
             },
             {
               "type": "string",
               "optional": false,
               "field": "first_name"
             },
             {
               "type": "string",
               "optional": false,
               "field": "last_name"
             },
             {
               "type": "string",
               "optional": false,
               "field": "email"
             }
           ],
           "optional": true,
           "name": "mysql-server-1.inventory.customers.Value", 
           "field": "before"
         },
         {
           "type": "struct",
           "fields": [
             {
               "type": "int32",
               "optional": false,
               "field": "id"
             },
             {
               "type": "string",
               "optional": false,
               "field": "first_name"
             },
             {
               "type": "string",
               "optional": false,
               "field": "last_name"
             },
             {
               "type": "string",
               "optional": false,
               "field": "email"
             }
           ],
           "optional": true,
           "name": "mysql-server-1.inventory.customers.Value",
           "field": "after"
         },
         {
           "type": "struct",
           "fields": [
             {
               "type": "string",
               "optional": false,
               "field": "version"
             },
             {
               "type": "string",
               "optional": false,
               "field": "connector"
             },
             {
               "type": "string",
               "optional": false,
               "field": "name"
             },
             {
               "type": "int64",
               "optional": false,
               "field": "ts_ms"
             },
             {
               "type": "boolean",
               "optional": true,
               "default": false,
               "field": "snapshot"
             },
             {
               "type": "string",
               "optional": false,
               "field": "db"
             },
             {
               "type": "string",
               "optional": true,
               "field": "table"
             },
             {
               "type": "int64",
               "optional": false,
               "field": "server_id"
             },
             {
               "type": "string",
               "optional": true,
               "field": "gtid"
             },
             {
               "type": "string",
               "optional": false,
               "field": "file"
             },
             {
               "type": "int64",
               "optional": false,
               "field": "pos"
             },
             {
               "type": "int32",
               "optional": false,
               "field": "row"
             },
             {
               "type": "int64",
               "optional": true,
               "field": "thread"
             },
             {
               "type": "string",
               "optional": true,
               "field": "query"
             }
           ],
           "optional": false,
           "name": "io.debezium.connector.mysql.Source", 
           "field": "source"
         },
         {
           "type": "string",
           "optional": false,
           "field": "op"
         },
         {
           "type": "int64",
           "optional": true,
           "field": "ts_ms"
         }
       ],
       "optional": false,
       "name": "mysql-server-1.inventory.customers.Envelope" 
     },
     "payload": { 
       "op": "c", 
       "ts_ms": 1465491411815, 
       "before": null, 
       "after": { 
         "id": 1004,
         "first_name": "Anne",
         "last_name": "Kretchmar",
         "email": "[email protected]"
       },
       "source": { 
         "version": "1.9.6.Final",
         "connector": "mysql",
         "name": "mysql-server-1",
         "ts_ms": 0,
         "snapshot": false,
         "db": "inventory",
         "table": "customers",
         "server_id": 0,
         "gtid": null,
         "file": "mysql-bin.000003",
         "pos": 154,
         "row": 0,
         "thread": 7,
         "query": "INSERT INTO customers (first_name, last_name, email) VALUES 
('Anne', 'Kretchmar', '[email protected]')"
       }
     }
   }
   ```
   ### Modifications
   
   1. Update DebeziumJsonDynamicSchemaFormat and 
DebeziumJsonDynamicSchemaFormatTest
   2. Add DebeziumJsonDynamicSchemaFormatWithSchemaTest
   3. 
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [x] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads 
(10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs 
/ not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up 
issue for adding the documentation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to