You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by françois lacombe <fr...@dcbrain.com> on 2019/02/08 16:58:54 UTC

[Table] Types of query result and tablesink do not match error

Hi all,

An error is currently raised when using table.insertInto("registeredSink")
in Flink 1.7.0 when types of table and sink don't match.

I've got the following :
org.apache.flink.table.api.ValidationException: Field types of query result
and registered TableSink null do not match.
Query result schema: [dynamicFields: Map, staticFields: Map]
TableSink schema:    [dynamicFields: Map, staticFields: Map]
    at
org.apache.flink.table.api.TableEnvironment.insertInto(TableEnvironment.scala:876)
    at org.apache.flink.table.api.Table.insertInto(table.scala:918)

Schemas are the same
All fields got the GenericType<java.util.Map> type and I don't understand
why they are so different.

Have you any additional way to get extra debug information ?
Any hint ?

All the best

François

-- 

 <http://www.dcbrain.com/>   <https://twitter.com/dcbrain_feed?lang=fr>   
<https://www.linkedin.com/company/dcbrain>   
<https://www.youtube.com/channel/UCSJrWPBLQ58fHPN8lP_SEGw>


 Pensez à la 
planète, imprimer ce papier que si nécessaire 

Re: [Table] Types of query result and tablesink do not match error

Posted by Fabian Hueske <fh...@gmail.com>.
Hi François,

I had a look at the code and the GenericTypeInfo checks equality by
comparing the classes the represent (Class<Map> == Class<Map>).
Class does not override the default implementation of equals, so this is an
instance equality check. The check can evaluate to false, if Map was loaded
by two different classloaders or if you use different implementations of
the interface.

Not sure if this explains the issue you are facing but it's a starting
point.

Best, Fabian

Am Fr., 8. Feb. 2019 um 18:08 Uhr schrieb françois lacombe <
francois.lacombe@dcbrain.com>:

> Hi all,
>
> An error is currently raised when using table.insertInto("registeredSink")
> in Flink 1.7.0 when types of table and sink don't match.
>
> I've got the following :
> org.apache.flink.table.api.ValidationException: Field types of query
> result and registered TableSink null do not match.
> Query result schema: [dynamicFields: Map, staticFields: Map]
> TableSink schema:    [dynamicFields: Map, staticFields: Map]
>     at
> org.apache.flink.table.api.TableEnvironment.insertInto(TableEnvironment.scala:876)
>     at org.apache.flink.table.api.Table.insertInto(table.scala:918)
>
> Schemas are the same
> All fields got the GenericType<java.util.Map> type and I don't understand
> why they are so different.
>
> Have you any additional way to get extra debug information ?
> Any hint ?
>
> All the best
>
> François
>
>
> <http://www.dcbrain.com/>   <https://twitter.com/dcbrain_feed?lang=fr>
> <https://www.linkedin.com/company/dcbrain>
> <https://www.youtube.com/channel/UCSJrWPBLQ58fHPN8lP_SEGw>
>
> [image: Arbre vert.jpg] Pensez à la planète, imprimer ce papier que si
> nécessaire
>