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

[jira] [Created] (FLINK-16269) Generic type can not be matched when convert table to stream.

xiemeilong created FLINK-16269:
----------------------------------

             Summary: Generic type can not be matched when convert table to stream.
                 Key: FLINK-16269
                 URL: https://issues.apache.org/jira/browse/FLINK-16269
             Project: Flink
          Issue Type: Bug
          Components: API / Type Serialization System
    Affects Versions: 1.10.0
            Reporter: xiemeilong


The query result schema printed by table.printSchema():
{noformat}
 |-- deviceId: BIGINT
 |-- channel: STRING
 |-- schemaId: BIGINT
 |-- productId: BIGINT
 |-- schema: LEGACY('RAW', 'ANY<com.yunmo.iot.schema.Schema>')
{noformat}
then excuting table.toRetractStream[DeviceSchema].print(), exception throwed:
{noformat}
Exception in thread "main" org.apache.flink.table.api.ValidationException: Field types of query result and registered TableSink do not match.
 Query schema: [deviceId: BIGINT, channel: STRING, schemaId: BIGINT, productId: BIGINT, schema: RAW('com.yunmo.iot.schema.Schema', ?)]
 Sink schema: [deviceId: BIGINT, channel: STRING, schemaId: BIGINT, productId: BIGINT, schema: LEGACY('RAW', 'ANY<com.yunmo.iot.schema.Schema>')]{noformat}
The com.yunmo.iot.schema.Schema is a generic type.

The schema field of Query schema change from LEGACY('RAW' to RAW, but the Sink schema still a LEGACY('RAW'



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