XMLWordPrintableJSON

Details

    Description

      Currently debezium json format  wrapper the json format to serialize/deserialize the debezuim json format data.

      But debezium json format has its own data type which consists of Literal Type and Semantic Type[1], i.g. Date type in debezium is an integer which represents the number of days since epoch rather than a string with 'yyyy-MM-dd' pattern.  

      {   "schema":{
            "fields":[  
             {            
                      "fields":[
                     {                 
                       "type":"int32",      //Literal Type
                        "optional":false,
                        "name":"io.debezium.time.Date", //semantic Type
                        "version":1,
                        "field":"order_date"
                     },
                     {                  "type":"int32",
                        "optional":false,
                        "field":"quantity"
                     }
                  ]
               }
            ]
         },
         "payload":{ 
            "before":null,
            "after":{ 
               "order_date":16852, // Literal Value, the number of days since epoch
              "quantity":1
            },
            "op":"c",
            "ts_ms":1596081813474
         }
      } 

       

      I think we need obtain the debezuim data type from schema information and then serialize/deserialize the data in payload.

      [1]https://debezium.io/documentation/reference/1.2/connectors/mysql.html

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            leonard Leonard Xu
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: