[ 
https://issues.apache.org/jira/browse/FLINK-20861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17259543#comment-17259543
 ] 

Jark Wu commented on FLINK-20861:
---------------------------------

I picked the name from 
{{com.fasterxml.jackson.core.JsonGenerator.Feature#WRITE_BIGDECIMAL_AS_PLAIN}} 
where it says it uses {{java.math.BigDecimal#toPlainString()}} to prevent 
values to be written using scientific notation. 

I'm also fine with {{json.encode.decimal-as-plain-number}} or 
{{json.encode.decimal-as-plain}}.

> Provide an option for serializing DECIMALs in JSON as plain number instead of 
> scientific notation
> -------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-20861
>                 URL: https://issues.apache.org/jira/browse/FLINK-20861
>             Project: Flink
>          Issue Type: Improvement
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile), Table 
> SQL / Ecosystem
>            Reporter: Q Kang
>            Assignee: Q Kang
>            Priority: Minor
>
> When using DECIMAL types in Flink SQL along with JSON format, it is quite 
> common to see that some large values are written out as scientific notation. 
> For example:
> Definition: `orderId DECIMAL(20, 0)`
> Input: `\{"orderId":454621864049246170}`
> Output (without transformations): `\{"orderId":4.5462186404924617E+17}`
> However, values in plain numbers are easier to understand and more convenient 
> for the case shown above. So we can provide a boolean option (say 
> `json.use-plain-decimals`?) to make this behavior tunable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to