Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwrap functions on parameter of DataType/TimestampType used in comparison with a literal #22244

Open
hantangwangd opened this issue Mar 20, 2024 · 3 comments

Comments

@hantangwangd
Copy link
Member

hantangwangd commented Mar 20, 2024

We can unwrap some specific functions on DataType/TimestampType used in comparison with a literal, so that we can further push down the predicate to connectors.

Expected Behavior or Use Case

Take function date() for example, we can unwrap date() for a timestamp parameter t as follows:

filter(date(t) = date `1984-01-08`) --> filter(t >= timestamp '1984-01-08 00:00:00.000' and t < timestamp '1984-01-09 00:00:00.000')

The same goes for function date_trunc(), year(), month(), day(), hour() etc. To be further supplemented.

Presto Component, Service, or Connector

Possible Implementation

Refer to: #16106, #14011, #14161, #7806

Context

@Sreesruth
Copy link

hi, @hantangwangd @joshk @electrum @jvanzyl @oggy i would like to contribute to this, thankyou

@hantangwangd
Copy link
Member Author

@Sreesruth Sure, please go for it!

@Sreesruth
Copy link

@hantangwangd , yea my github was acting up it kept crashing yesterday but i was able to fork it, thankyou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Unprioritized
Development

No branches or pull requests

2 participants