Field references inside and outside of the subquery should be distinguished #27735
Labels
.Backend
Priority:P2
Average run of the mill bug
Querying/MBQL
Querying/Nested Queries
Questions based on other saved questions
.Team/QueryProcessor
:hammer_and_wrench:
Type:Bug
Product defects
.Wanted: MLv2
Issues that will be fixed (or easier to fix, or possible to fix) when we have MLv2
Describe the bug
References to the results of nested queries is incorrect when the result is produced by applying a non-idempotent function.
For example, the following (nonsensical) query
is sent as the following MBQL query to the backend:
The backend then tries to extract the month from the
LAST_LOGIN
result of the subquery which fails.A more complicated example having the same problem can be found in #17769.
Potential solution
References inside the query should be distinguished from the references to the results of the subquery. For example,
Dependencies
Implementing the fix should be much easier after the completion of #proj-metabase-lib because then the changes will mostly be confined to the Clojure world and few additional frontend changes will be necessary.
The text was updated successfully, but these errors were encountered: