Skip to content

Incorrect ORDER BY in unparser after DF 52 upgrade #20905

@alamb

Description

@alamb

Describe the bug

Filing on behalf @krinart / #20658

Two regressions in the DuckDB federation unparser after upgrading to DataFusion 52:

  1. clickbench q25: Queries like SELECT "SearchPhrase" ... ORDER BY to_timestamp("EventTime") LIMIT 10 produce ORDER BY outside the subquery, referencing table names ("hits") that are out of scope.
  2. tpcds q36: ORDER BY with GROUPING() expressions loses the derived_sort subquery alias, placing sort references outside their valid scope.F

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions