Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Expression short-circuiting and null friendliness for operations in Ops #111

Open
lalithsuresh opened this issue Jun 24, 2021 · 1 comment

Comments

@lalithsuresh
Copy link
Contributor

An operation of the form CHECK x = 10 OR var1 = col1, currently gets compiled down to a series of ortools operations that constructs the full expression without returning early. If x=10 but var1 is null, we still get an NPE when passing an argument to Ops.

The above operation is equivalent to WHERE x != 10 CHECK var1 = col1, which generates an if-expression that only encodes the constraints for rows that pass the x != 10 predicate. Doing so makes this safe for use cases where var1 might be null if x=10 but has a value otherwise.

It's worth considering what the behavior should be in the presence of nulls and whether we can potentially rewrite the IR.

@lalithsuresh
Copy link
Contributor Author

Fixing #37 would help deal with this problem.

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

No branches or pull requests

1 participant