databend icon indicating copy to clipboard operation
databend copied to clipboard

bug: timestamp sub-query filter condition doesn't push down

Open jackjoesh opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

v1.2.307

What's Wrong?

timestamp sub-query filter condition doesn't push down

How to Reproduce?

CREATE TABLE date_sub_query_test ( ID BIGINT NULL, test_time timestamp NULL )

insert into date_sub_query_test values(1,'2024-03-19 00:00:00'); insert into date_sub_query_test values(2,'2024-03-19 01:00:00'); insert into date_sub_query_test values(3,now());

explain select * from date_sub_query_test where test_time >= (select now());

image

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

jackjoesh avatar Mar 19 '24 09:03 jackjoesh

You can change the predicate to test_time >= now() to solve this issue, we will optimize this syntax in the future https://github.com/datafuselabs/databend/issues/15020.

Dousir9 avatar Mar 19 '24 09:03 Dousir9