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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

françois lacombe
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


      

Arbre vert.jpg Pensez à la planète, imprimer ce papier que si nécessaire 
Reply | Threaded
Open this post in threaded view
|

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

Fabian Hueske-2
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 <[hidden email]>:
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


      

Arbre vert.jpg Pensez à la planète, imprimer ce papier que si nécessaire