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/05/13 03:23:00 UTC

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

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

xiemeilong commented on FLINK-16269:
------------------------------------

After upgrade to 1.10.1,  a new type mismatch occurred.
{code:java}
Exception in thread "main" org.apache.flink.table.api.ValidationException: Field types of query result and registered TableSink  do not match.
Query schema: [......., evaluator: ROW<`className` STRING, `code` STRING>, ........]
Sink schema: [........, evaluator: LEGACY('STRUCTURED_TYPE', 'POJO<com.yunmo.iot.dsl.GeneratedRuleEvaluator>'),.......]{code}
The evaluator  in query is returned by a registed function, the evaluator in sink is a field of case class.  they are the same GeneratedRuleEvaluator class.

 

> 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: Table SQL / API
>    Affects Versions: 1.10.0
>            Reporter: xiemeilong
>            Assignee: Jark Wu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.1, 1.11.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)