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

hk__lrzy updated FLINK-29373:
-----------------------------
    Description: 
When we want to transfrom datastream to table, `TypeInfoDataTypeConverter` will 
try to convert `TypeInformation` to `DataType`. But if datastream's produce 
types contains `BigDecimalTypeInfo`, `TypeInfoDataTypeConverter` will convert 
it `RawDataType`.

Then when we want tranfrom table to datastream again, exception will hapend.

!image-2022-09-21-15-12-11-082.png!

 

```
Caused by: org.apache.flink.table.codegen.CodeGenException: Incompatible types 
of expression and result type. 
Expression[GeneratedExpression(result$10,isNull$11,,Decimal(9,2),false)] type 
is [Decimal(9,2)], result type is [GenericType<java.math.BigDecimal>]
```

  was:
When we want to transfrom datastream to table, `TypeInfoDataTypeConverter` will 
try to convert `TypeInformation` to `DataType`. But if datastream's produce 
types contains `BigDecimalTypeInfo`, `TypeInfoDataTypeConverter` will convert 
it `RawDataType`.

Then when we want tranfrom table to datastream again, exception will hapend.

!image-2022-09-21-15-12-11-082.png!

 


> DataStream to table not support BigDecimalTypeInfo
> --------------------------------------------------
>
>                 Key: FLINK-29373
>                 URL: https://issues.apache.org/jira/browse/FLINK-29373
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.17.0
>            Reporter: hk__lrzy
>            Priority: Major
>         Attachments: image-2022-09-21-15-12-11-082.png
>
>
> When we want to transfrom datastream to table, `TypeInfoDataTypeConverter` 
> will try to convert `TypeInformation` to `DataType`. But if datastream's 
> produce types contains `BigDecimalTypeInfo`, `TypeInfoDataTypeConverter` will 
> convert it `RawDataType`.
> Then when we want tranfrom table to datastream again, exception will hapend.
> !image-2022-09-21-15-12-11-082.png!
>  
> ```
> Caused by: org.apache.flink.table.codegen.CodeGenException: Incompatible 
> types of expression and result type. 
> Expression[GeneratedExpression(result$10,isNull$11,,Decimal(9,2),false)] type 
> is [Decimal(9,2)], result type is [GenericType<java.math.BigDecimal>]
> ```



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

Reply via email to