[ 
https://issues.apache.org/jira/browse/FLINK-36970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiao Huang updated FLINK-36970:
-------------------------------
    Description: 
In SchemaMergingUtils#getLeastCommonType, the merge result of BIGINT and DOUBLE 
is STRING now.

However, considering JSON string, JSON number can be integers or floating 
point. Data type of integers can be inferred as BIGINT, and floating point can 
be inferred as DOUBLE. So a JSON number field will be inferred as STRING, which 
is confusing.

  was:
In SchemaMergingUtils#getLeastCommonType, the merge result of BIGINT and DOUBLE 
is STRING now.

However, considering JSON string, JSON number can be integers or floating 
point. Data type of integers can be inferred as BIGINT, and floating point can 
be inferred as DOUBLE. So a JSON number field will be inferred as STRING, which 
is confusing.

The merge result of numerical types should always be a numerical type.


> Merge result of data type BIGINT and DOUBLE should be DOUBLE instead of STRING
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-36970
>                 URL: https://issues.apache.org/jira/browse/FLINK-36970
>             Project: Flink
>          Issue Type: Improvement
>          Components: Flink CDC
>            Reporter: Xiao Huang
>            Priority: Major
>
> In SchemaMergingUtils#getLeastCommonType, the merge result of BIGINT and 
> DOUBLE is STRING now.
> However, considering JSON string, JSON number can be integers or floating 
> point. Data type of integers can be inferred as BIGINT, and floating point 
> can be inferred as DOUBLE. So a JSON number field will be inferred as STRING, 
> which is confusing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to