Filter Date type in Table API

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

Filter Date type in Table API

Soheil Pourbafrani
Hi, I want to filter a field of type Date (Java.sql.Date) like the following:

filter("f_date <= '1998-10-02'")
and 
filter("f_date <= '1998/10/02'")
Expression 'f_date <= 1998/10/02 failed on input check: Comparison is only supported for numeric types and comparable types of same type, got Date and String

I tried giving the date without a single quotation but it errors:
Expression 'f_date <= ((1998 / 10) / 2) failed on input check: Comparison is only supported for numeric types and comparable types of same type, got Date and Integer
Reply | Threaded
Open this post in threaded view
|

Re: Filter Date type in Table API

Zhenghua Gao
Just try: filter("f_date <= '1998-10-02'.toDate")



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/