Skip to content

[Bug]: WHERE filter within the CTE, MO fails to correctly push down the filtering conditions. #24020

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

3.0-dev

Commit ID

6d57944

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

Image

USE SFC_POC;
SELECT COUNT(*) AS direct_rows FROM (
SELECT STOCK_CODE, INDUSTRY_NAME FROM (
SELECT STOCK_CODE, INDUSTRY_NAME,
ROW_NUMBER() OVER (PARTITION BY STOCK_CODE ORDER BY MODIFIED_DATE DESC) AS rn
FROM ds_t_int_hsicl_dtl WHERE MODIFIED_DATE <= '2025-10-31'
) t WHERE rn = 1
) d WHERE INDUSTRY_NAME='Consumer Discretionary';

mo_poc.sql

please contact me for data.

Image

Expected Behavior

No response

Steps to Reproduce

as above

Additional information

No response

Activity

  1. added this to the MO-202603 milestone on Mar 30, 2026
  2. added
    kind/bug
    severity/s0
    on Mar 30, 2026
  3. added theissue type on Mar 30, 2026
  4. ck89119 commented on Apr 3, 2026

    @ck89119
    Contributor

    fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions