You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Bonino Dario <da...@gmail.com> on 2020/05/14 16:42:06 UTC

How to read UUID out of a JDBC table source

Dear list,

I need to use a Table Source to extract data from a PostgreSQL table 
that includes a column of type uuid. Data in the column is converted to 
java.util.UUID by the postgresql jdbc driver (I guess) however I was not 
able to find a way to define a Table schema for correctly reading that 
column (selecting RAW(TypeInformation.of(UUID.class)) does not work 
providing the following error:

org.apache.flink.table.api.ValidationException: Type 
RAW('java.util.UUID', ?) of table field 'datastream' does not match with 
the physical type LEGACY('RAW', 'ANY<java.util.UUID>') of the 
'datastream' field of the TableSource return type.

Did someone encountered the same issue? Does someone have any suggestion 
on how to proceed?


Thank you very much

Dario


-- 
Ing. Dario Bonino, Ph.D

e-m@il: dario.bonino@gmail.com
www: https://www.linkedin.com/in/dariobonino
<foaf:Person>
	<foaf:firstName>Dario</foaf:firstName>
	<foaf:surname>Bonino</foaf:surname>
	<foaf:msnChatID>slide473@hotmail.com</foaf:msnChatID>
</foaf:Person>


Re: How to read UUID out of a JDBC table source

Posted by Dawid Wysakowicz <dw...@apache.org>.
Hi Dario,

What version of Flink are you using? Are you implementing your own
TableSource or do you use the JdbcTableSource that comes with Flink?
Which planner do you use blink or the old one?

Unfortunately the rework of Table API type system is not finished yet,
therefore there are still rough edges, sorry about that. If you are
implementing your own source make sure you return
DataTypes.RAW(TypeInformation.of(UUID.class) in both the TableSchema and
getProducedDataType.

Best,

Dawid

On 14/05/2020 18:42, Bonino Dario wrote:
>
> Dear list,
>
> I need to use a Table Source to extract data from a PostgreSQL table
> that includes a column of type uuid. Data in the column is converted
> to java.util.UUID by the postgresql jdbc driver (I guess) however I
> was not able to find a way to define a Table schema for correctly
> reading that column (selecting RAW(TypeInformation.of(UUID.class))
> does not work providing the following error:
>
> org.apache.flink.table.api.ValidationException: Type
> RAW('java.util.UUID', ?) of table field 'datastream' does not match
> with the physical type LEGACY('RAW', 'ANY<java.util.UUID>') of the
> 'datastream' field of the TableSource return type.
>
> Did someone encountered the same issue? Does someone have any
> suggestion on how to proceed?
>
>
> Thank you very much
>
> Dario
>
>
> -- 
> Ing. Dario Bonino, Ph.D
>
> e-m@il: dario.bonino@gmail.com 
> www: https://www.linkedin.com/in/dariobonino
> <foaf:Person>
> 	<foaf:firstName>Dario</foaf:firstName>
> 	<foaf:surname>Bonino</foaf:surname>
> 	<foaf:msnChatID>slide473@hotmail.com</foaf:msnChatID>
> </foaf:Person>