[MCOL-4719] ColumnStore ignores where clause: inline view with a window function Created: 2021-05-12 Updated: 2023-06-12 Resolved: 2021-08-04 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 5.5.1 |
| Fix Version/s: | 6.2.1, 6.2.2 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Edward Stoever | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
10.5.9-6-MariaDB-enterprise-log |
||
| Sprint: | 2021-9, 2021-10 |
| Description |
|
When columnstore_select_handler=on this query should return only 2 rows. Instead it returns all rows.
|
| Comments |
| Comment by David Hall (Inactive) [ 2021-07-19 ] | ||||||||||||||||||
|
Another, perhaps more palatable, workaround:
--------
-------- | ||||||||||||||||||
| Comment by David Hall (Inactive) [ 2021-07-19 ] | ||||||||||||||||||
|
I have run this test on 1.1, 1.2, and 1.4. All showed the same deviant behavior. | ||||||||||||||||||
| Comment by David Hall (Inactive) [ 2021-07-21 ] | ||||||||||||||||||
|
Analysis:
Optimization attempts to push filters from the outer select to the inner select. This isn't done if the filter is on a result of an aggregation or window function. When the inner select doesn't have the operator, it notices that the filter is on the window function and doesn't optimize. But when the inner function has an operator that includes the window function, the code only sees the operator and attempts to optimize, causing an illegal filter on the result of a window function which appears to turn into a noop in the lower code. The fix is to have the code delve into the operator (or function or whatever) to see what windows or aggregates might lurk inside and suppress the optimization accordingly. | ||||||||||||||||||
| Comment by David Hall (Inactive) [ 2021-07-22 ] | ||||||||||||||||||
|
QA
You should be able to create a subquery with any number of nested functions and operators with internal aggregates and window functions. | ||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2021-08-04 ] | ||||||||||||||||||
|
Build verified: 6.2.1-1 ( #2921) |