1.9 timestamp type default

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

1.9 timestamp type default

Fanbin Bu
Hi,

According to 
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
Reply | Threaded
Open this post in threaded view
|

Re: 1.9 timestamp type default

Rui Li
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 <[hidden email]> wrote:
Hi,

According to 
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
Reply | Threaded
Open this post in threaded view
|

Re: 1.9 timestamp type default

Timo Walther
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 <[hidden email]
> <mailto:[hidden email]>> 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