Skip to content

Swap if with comparator to get rid of nothing #8564

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

Open
zverevgeny opened this issue Aug 31, 2024 · 1 comment
Open

Swap if with comparator to get rid of nothing #8564

zverevgeny opened this issue Aug 31, 2024 · 1 comment
Assignees

Comments

@zverevgeny
Copy link
Collaborator

zverevgeny commented Aug 31, 2024

Currently ssaProgram doesn't support nulls. And so predicate with Nothing can't be pushed down
But in some cases it's possible to get rid of Nothing by rewriting a predicate

example predicate:
(case when household_demographics.hd_vehicle_count > 0
then household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count
else null
end) > 1.2

it can be rewritten to:
if (household_demographics.hd_vehicle_count > 0, household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count > 1.2, false)

@pavelvelikhov
Copy link
Collaborator

I don't see how you can rewrite this predicate to get rid of nulls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants