[MBQL lib] `filter-parts` wrongly assumes the first argument is always a `:field`-like clause
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 49.3k
- Forks
- 6.8k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 653
Description
That assumption is true in the GUI but other features can add queries which don't fit this pattern.
In particular, sandboxing adds filters where the LHS is a `[:!= {} [:field ...] 0]` subexpression. `filter-parts` tries to pass that as `a-ref` to `lib.equality/find-matching-column` and it throws because `:!=` is not `:field`, `:expression` or `:aggregation`.
It's not clear whether this is the cause of the performance regression reported in #44359.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating `filter-parts` and tracing its call to `lib.equality/find-matching-column`. Reproduce the sandboxing case where the LHS is `[:!= {} [:field ...] 0]`, and compare it with the GUI filter shape. Done means the non-`:field`-like clause no longer causes an exception; investigate #44359 separately for the possible performance connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100