Carl-Zhou-CN commented on issue #7010:
URL: https://github.com/apache/seatunnel/issues/7010#issuecomment-2182137070

       @Test
       public void testSerializeDecimalToNumber()
               throws InvocationTargetException, IllegalAccessException, 
JsonProcessingException {
           String key = "k";
           String value = "v";
           Struct keyStruct =
                   new Struct(SchemaBuilder.struct().field(key, 
Decimal.builder(12).build()).build());
           keyStruct.put(key, BigDecimal.valueOf(0000000000001l,12));
           Struct valueStruct =
                   new Struct(SchemaBuilder.struct().field(value, 
Decimal.builder(12).build()).build());
           valueStruct.put(value, BigDecimal.valueOf(0000000000001l,12));
   
           SourceRecord sourceRecord =
                   new SourceRecord(
                           Collections.emptyMap(),
                           Collections.emptyMap(),
                           null,
                           keyStruct.schema(),
                           keyStruct,
                           valueStruct.schema(),
                           valueStruct);
   
           DebeziumJsonConverter converter = new DebeziumJsonConverter(false, 
false);
           Assertions.assertEquals("{\"k\":0000000000001}", 
converter.serializeKey(sourceRecord));
           Assertions.assertEquals("{\"v\":0000000000001}", 
converter.serializeValue(sourceRecord));
       }


-- 
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