Skip to content

Optimizer adds redundant projections on casts with confusing alias #3786

@andygrove

Description

@andygrove

Describe the bug

#3764 fixed one regression but introduced another.

I do not understand why this additional projection is being added.

Before

Inner Join: store_sales.ss_sold_date_sk = date_dim.d_date_sk

After

Projection: CAST(date_dim.d_moy AS Int64) AS CAST(date_dim.d_moy AS Int64)date_dim.d_moy, store_sales.ss_customer_sk, date_dim.d_year
  Inner Join: store_sales.ss_sold_date_sk = date_dim.d_date_sk

To Reproduce
No repro available yet

Expected behavior

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoptimizerOptimizer rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions