aymkhalil commented on issue #20092: URL: https://github.com/apache/pulsar/issues/20092#issuecomment-1509027797
Thanks @tisonkun - I verified your patch locally and it works well. I think it is reasonable because IIUC the `USE_BIG_DECIMAL_FOR_FLOATS` works for deserialization and used internally to fix the referenced SQL issue, but your patch makes the JsonNode respect the schema which is what an external user would expect (in between, there wouldn't be any precision loss). If it makes sense, one potential test case is to make sure the GenericJsonObject and the JsonNode available via NativeObject return the same node types. For example, before your patch ``` ((JsonNode)message.getValue().getNativeObject()).get("xdouble").numberValue() --> BigDecimal ((GenericJsonRecord)message.getValue()).getField("xdouble") --> Double ``` The reason why the latter would work before your fix is because it uses the constructor variant that accepts the schema info. A test to detect a mismatch would've been one early indicator. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org