You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Benoît Paris (Jira)" <ji...@apache.org> on 2020/02/25 13:08:00 UTC

[jira] [Updated] (FLINK-16277) StreamTableEnvironment.toAppendStream fails with Decimal types

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

Benoît Paris updated FLINK-16277:
---------------------------------
    Description: 
The following fails when there is a Decimal type in the underlying TableSource:

 
{code:java}
DataStream<Row> appendStream = tEnv.toAppendStream(
  asTable,
  asTable.getSchema().toRowType()
);{code}
Yielding the following error:

 

ValidationException: Type ROW<`y` DECIMAL(38, 18)> of table field 'payload' does not match with the physical type ROW<`y` LEGACY('DECIMAL', 'DECIMAL')> of the 'payload' field of the TableSource return type
----
 

Remarks:

* toAppendStream is not ready for the new type system, does not accept the new DataTypes

* The LegacyTypeInformationType transition type hinders things. Replacing it with the new 

DataTypes.DECIMAL type makes things work.

* flink-json is not ready for the new type system, does not give the new DataTypes

 

Workaround: reprocess TypeConversions.fromLegacyInfoToDataType's output to replace LegacyTypeInformationType types when they are of DECIMAL typeroot with the new types.

 

Included is reproduction and workaround (activated by line 127) code, with java + pom + stacktrace files.

 

  was:
The following fails when there is a Decimal type in the underlying TableSource:

 
{code:java}
DataStream<Row> appendStream = tEnv.toAppendStream(
  asTable,
  asTable.getSchema().toRowType()
);{code}
Yielding the following error:

 

ValidationException: Type ROW<`y` DECIMAL(38, 18)> of table field 'payload' does not match with the physical type ROW<`y` LEGACY('DECIMAL', 'DECIMAL')> of the 'payload' field of the TableSource return type
----
 

Remarks:

* toAppendStream is not ready for the new type system, does not accept the new DataTypes

* The LegacyTypeInformationType transition type hinders things. Replacing it with the new 

DataTypes.DECIMAL type makes things work.

 

Workaround: reprocess TypeConversions.fromLegacyInfoToDataType's output to replace LegacyTypeInformationType types when they are of DECIMAL typeroot with the new types.

 

Included is reproduction and workaround (activated by line 127) code, with java + pom + stacktrace files.

 


> StreamTableEnvironment.toAppendStream fails with Decimal types
> --------------------------------------------------------------
>
>                 Key: FLINK-16277
>                 URL: https://issues.apache.org/jira/browse/FLINK-16277
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Legacy Planner, Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: Benoît Paris
>            Priority: Major
>         Attachments: flink-test-schema-update.zip
>
>
> The following fails when there is a Decimal type in the underlying TableSource:
>  
> {code:java}
> DataStream<Row> appendStream = tEnv.toAppendStream(
>   asTable,
>   asTable.getSchema().toRowType()
> );{code}
> Yielding the following error:
>  
> ValidationException: Type ROW<`y` DECIMAL(38, 18)> of table field 'payload' does not match with the physical type ROW<`y` LEGACY('DECIMAL', 'DECIMAL')> of the 'payload' field of the TableSource return type
> ----
>  
> Remarks:
> * toAppendStream is not ready for the new type system, does not accept the new DataTypes
> * The LegacyTypeInformationType transition type hinders things. Replacing it with the new 
> DataTypes.DECIMAL type makes things work.
> * flink-json is not ready for the new type system, does not give the new DataTypes
>  
> Workaround: reprocess TypeConversions.fromLegacyInfoToDataType's output to replace LegacyTypeInformationType types when they are of DECIMAL typeroot with the new types.
>  
> Included is reproduction and workaround (activated by line 127) code, with java + pom + stacktrace files.
>  



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