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

colexec: problems with AND and OR operators #40913

Closed
2 tasks done
yuzefovich opened this issue Sep 19, 2019 · 0 comments · Fixed by #40847
Closed
2 tasks done

colexec: problems with AND and OR operators #40913

yuzefovich opened this issue Sep 19, 2019 · 0 comments · Fixed by #40847
Assignees
Labels
A-sql-vec SQL vectorized engine C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@yuzefovich
Copy link
Member

yuzefovich commented Sep 19, 2019

Currently, we have some issues with AND and OR logical operators when they are used as projecitons:

  • AND doesn't follow the short-circuiting approach
statement ok
DROP TABLE IF EXISTS t; CREATE TABLE t (k INT PRIMARY KEY, a INT, b INT)

statement ok
INSERT INTO t VALUES (1, NULL, NULL), (2, NULL, 1), (3, 1, NULL), (4, 2, 0), (5, 3, 3)

# Test AND short-circuiting projection logic (check that the right side is not
# evaluated when the left side is false).
query B
SELECT a <> 2 AND 3 / b = 1 FROM t ORDER BY k
----
NULL
false
NULL
false
true
  • OR expression is replaced by CASE operator that is not fully equivalent to the desired expression when nulls are present.
@yuzefovich yuzefovich added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-vec SQL vectorized engine labels Sep 19, 2019
@yuzefovich yuzefovich self-assigned this Sep 19, 2019
@craig craig bot closed this as completed in f379a9d Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-vec SQL vectorized engine C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant