You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Fanbin Bu <fa...@coinbase.com> on 2020/02/14 00:47:18 UTC

1.9 timestamp type default

Hi,

According to
https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/types.html#timestamp
,
the default java bridge time for timestamp is java.time.LocalDateTime. Is
there a setting that can change it to use
java.sql.Timestamp instead?

Thanks,
Fanbin

Re: 1.9 timestamp type default

Posted by Timo Walther <tw...@apache.org>.
Hi,

the type system is still under heavy refactoring that touches a lot of 
interfaces. Where would you like to use java.sql.Timestamp? UDFs are not 
well supported right now. Source and sinks might work for the Blink 
planner and java.sql.Timestamp is the only supported conversion class of 
old planner. Usage is as Rui explained.

Regards,
Timo


On 14.02.20 02:37, Rui Li wrote:
> Hi,
> 
> I don't think there's a config to change the default behavior. But you 
> can change the bridged class programmatically like: 
> DataTypes.TIMESTAMP(9).bridgedTo(java.sql.Timestamp.class)
> 
> On Fri, Feb 14, 2020 at 8:47 AM Fanbin Bu <fanbin.bu@coinbase.com 
> <ma...@coinbase.com>> wrote:
> 
>     Hi,
> 
>     According to
>     https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/types.html#timestamp,
>     the default java bridge time for timestamp is
>     java.time.LocalDateTime. Is there a setting that can change it to use
>     java.sql.Timestamp instead?
> 
>     Thanks,
>     Fanbin
> 
> 
> 
> -- 
> Best regards!
> Rui Li


Re: 1.9 timestamp type default

Posted by Rui Li <li...@gmail.com>.
Hi,

I don't think there's a config to change the default behavior. But you can
change the bridged class programmatically like:
DataTypes.TIMESTAMP(9).bridgedTo(java.sql.Timestamp.class)

On Fri, Feb 14, 2020 at 8:47 AM Fanbin Bu <fa...@coinbase.com> wrote:

> Hi,
>
> According to
>
> https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/types.html#timestamp
> ,
> the default java bridge time for timestamp is java.time.LocalDateTime. Is
> there a setting that can change it to use
> java.sql.Timestamp instead?
>
> Thanks,
> Fanbin
>


-- 
Best regards!
Rui Li