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

[BUG] Unable to evaluate valid filters #182

Closed
joocer opened this issue Jun 11, 2022 · 2 comments
Closed

[BUG] Unable to evaluate valid filters #182

joocer opened this issue Jun 11, 2022 · 2 comments
Assignees
Labels
Awaiting Closure Fixed - waiting for merging/releasing Bug 🪲 Something isn't working High Priority 1️⃣

Comments

@joocer
Copy link
Contributor

joocer commented Jun 11, 2022

replicated with sample data:

SELECT * FROM $astronauts
WHERE name LIKE '%o%' 
    AND `year` > 1900
    AND (gender ILIKE '%ale%' AND group IN (1,2,3,4,5,6))
@joocer joocer added the Bug 🪲 Something isn't working label Jun 11, 2022
@joocer joocer self-assigned this Jun 11, 2022
@joocer
Copy link
Contributor Author

joocer commented Jun 11, 2022

plan for this is:

[
    [
        (`name` like "%o%"),
        (`year` > 1900.0)
    ],
    (
        [
            (`gender` ilike "%ale%"),
            (`group` in [1.0, 2.0, 3.0, 4.0, 5.0, 6.0])
        ]
    )
]

I think the problem is the tuple around the list - that should just be the list without the tuple around it.

@joocer
Copy link
Contributor Author

joocer commented Jun 11, 2022

Three or more AND conditions result in DNF unable to be processed:

EXPLAIN SELECT * FROM $astronauts
WHERE `year` > 1965 AND gender = 'Male' AND group = 3
[[(`year` > 1965.0),(`gender` = "Male")],(`group` = 3.0)]

which, for ease of reading is:

[[ (A), (B) ], (C) ]

Which should evaluate correctly, but the processor assumes all of the elements in an iterable are the same, the list around (A),(B) isn't able to be processed with the C condition, as these aren't the same.

Putting (C) in a list would solve the validity problem, but it changes the meaning of the filter, that would then be (A and B) or C - what it should be is [(A),(B),(C)]

@joocer joocer added High Priority 1️⃣ Awaiting Closure Fixed - waiting for merging/releasing labels Jun 11, 2022
joocer added a commit that referenced this issue Jun 11, 2022
joocer added a commit that referenced this issue Jun 11, 2022
joocer added a commit that referenced this issue Jun 11, 2022
@joocer joocer closed this as completed Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Closure Fixed - waiting for merging/releasing Bug 🪲 Something isn't working High Priority 1️⃣
Projects
None yet
Development

No branches or pull requests

1 participant