[ https://issues.apache.org/jira/browse/FLINK-35696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Wysakowicz updated FLINK-35696: ------------------------------------- Description: {code} SELECT JSON_VALUE('{"bigNumber":123456789.987654321}', '$.bigNumber') {code} produces {code} "1.2345678998765433E8" {code} which can not be mapped back. It gets rounded. The reason is we use {{double}} for floats in {{SqlJsonUtils}}. We should rather configure {{jackson}} to use {{BigDecimals}}. In order to do that we need to properly shade {{jayway}} though. I suggest we: 1. Add {{com.jayway.jsonpath:son-path}} to {{flink-shaded}} 2. We use the shaded library and pass a configured mapper which maps floats to {{BigDecimal}} was: {code} SELECT JSON_VALUE('{"bigNumber":123456789.987654321}', '$.bigNumber') {code} produces {code} 1.2345678998765433E8 {code} which can not be mapped back. It gets rounded. The reason is we use {{double}} for floats in {{SqlJsonUtils}}. We should rather configure {{jackson}} to use {{BigDecimals}}. In order to do that we need to properly shade {{jayway}} though. I suggest we: 1. Add {{com.jayway.jsonpath:son-path}} to {{flink-shaded}} 2. We use the shaded library and pass a configured mapper which maps floats to {{BigDecimal}} > JSON_VALUE/QUERY functions incorrectly map floating numbers > ----------------------------------------------------------- > > Key: FLINK-35696 > URL: https://issues.apache.org/jira/browse/FLINK-35696 > Project: Flink > Issue Type: Bug > Components: Table SQL / Runtime > Affects Versions: 1.19.1 > Reporter: Dawid Wysakowicz > Priority: Major > Fix For: 1.20.0 > > > {code} > SELECT JSON_VALUE('{"bigNumber":123456789.987654321}', '$.bigNumber') > {code} > produces > {code} > "1.2345678998765433E8" > {code} > which can not be mapped back. It gets rounded. > The reason is we use {{double}} for floats in {{SqlJsonUtils}}. We should > rather configure {{jackson}} to use {{BigDecimals}}. In order to do that we > need to properly shade {{jayway}} though. > I suggest we: > 1. Add {{com.jayway.jsonpath:son-path}} to {{flink-shaded}} > 2. We use the shaded library and pass a configured mapper which maps floats > to {{BigDecimal}} -- This message was sent by Atlassian Jira (v8.20.10#820010)