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

Weird interaction between filter optimization and keys in planner/calcite #125

Open
KinanBab opened this issue Apr 12, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@KinanBab
Copy link
Collaborator

Calcite opt rules understand when columns are supposed to be equal (on joins) and pushes conditions on one of them below the join on both branches, making both columns keys in cases where one of them is conditioned on with ?

If the other column is ever dropped, Pelton throws an error as it believes a key was dropped.

Example:

CREATE TABLE art (id int NOT NULL PRIMARY KEY, title varchar(16) NOT NULL) ENGINE = ROCKSDB;
CREATE TABLE vt (id int PRIMARY KEY AUTO_INCREMENT, u int NOT NULL, article_id int NOT NULL) ENGINE = ROCKSDB;
CREATE VIEW  vn AS '"\
SELECT art.id, art.title, count(*) as votes \
FROM art \
JOIN vt ON art.id = vt.article_id \
GROUP BY art.id, art.title, vt.article_id \
HAVING art.id = ?"';
@KinanBab KinanBab added the bug Something isn't working label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant