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

Reduce "useless" CASE expressions #5571

Closed
gianm opened this issue Apr 4, 2018 · 0 comments
Closed

Reduce "useless" CASE expressions #5571

gianm opened this issue Apr 4, 2018 · 0 comments

Comments

@gianm
Copy link
Contributor

gianm commented Apr 4, 2018

In general CASE WHEN X THEN true ELSE false END could just be reduced to X. For example, a query seen in the wild contained:

((CASE WHEN (( generic.__time ) >= (TIME_PARSE('2018-03-08 00:00:00.000', 'yyyy-MM-dd HH:mm:ss.SSS')) AND ( generic.__time ) < (TIME_PARSE('2018-03-09 00:00:00.000', 'yyyy-MM-dd HH:mm:ss.SSS'))) THEN true ELSE false END))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant